android.graphics.drawable.Drawable.getMinimumHeight()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(194)

本文整理了Java中android.graphics.drawable.Drawable.getMinimumHeight()方法的一些代码示例,展示了Drawable.getMinimumHeight()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Drawable.getMinimumHeight()方法的具体详情如下:
包路径:android.graphics.drawable.Drawable
类名称:Drawable
方法名:getMinimumHeight

Drawable.getMinimumHeight介绍

暂无

代码示例

代码示例来源:origin: bumptech/glide

@Override
public int getMinimumHeight() {
 return wrapped.getMinimumHeight();
}

代码示例来源:origin: facebook/litho

@Override
public int getMinimumHeight() {
 return mDrawable == null ? UNSET : mDrawable.getMinimumHeight();
}

代码示例来源:origin: rey5137/material

@Override
public int getMinimumHeight() {
  return (mDrawable != null ? mDrawable.getMinimumHeight() : 0) + mPaddingTop + mPaddingBottom;
}

代码示例来源:origin: facebook/litho

@Override
 public int getMinimumHeight() {
 return mDrawable.getMinimumHeight();
}

代码示例来源:origin: facebook/litho

@Override
public int getMinimumHeight() {
 return mDrawable.getMinimumHeight();
}

代码示例来源:origin: seven332/EhViewer

public int getMinimumHeight() {
 return this.mDrawable.getMinimumHeight();
}

代码示例来源:origin: chentao0707/SimplifyReader

void drawOverscrollHeader(Canvas canvas, Drawable drawable, Rect bounds) {
  final int height = drawable.getMinimumHeight();
  canvas.save();
  canvas.clipRect(bounds);
  final int span = bounds.bottom - bounds.top;
  if (span < height) {
    bounds.top = bounds.bottom - height;
  }
  drawable.setBounds(bounds);
  drawable.draw(canvas);
  canvas.restore();
}

代码示例来源:origin: chentao0707/SimplifyReader

void drawOverscrollFooter(Canvas canvas, Drawable drawable, Rect bounds) {
  final int height = drawable.getMinimumHeight();
  canvas.save();
  canvas.clipRect(bounds);
  final int span = bounds.bottom - bounds.top;
  if (span < height) {
    bounds.bottom = bounds.top + height;
  }
  drawable.setBounds(bounds);
  drawable.draw(canvas);
  canvas.restore();
}

代码示例来源:origin: bm-x/PhotoView

private static int getDrawableHeight(Drawable d) {
  int height = d.getIntrinsicHeight();
  if (height <= 0) height = d.getMinimumHeight();
  if (height <= 0) height = d.getBounds().height();
  return height;
}

代码示例来源:origin: yanzhenjie/NoHttp

public static void setDrawableBounds(Drawable drawable) {
  if (drawable != null)
    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
}

代码示例来源:origin: Hitomis/transferee

private static int getDrawableHeight(Drawable d) {
  int height = d.getIntrinsicHeight();
  if (height <= 0) height = d.getMinimumHeight();
  if (height <= 0) height = d.getBounds().height();
  return height;
}

代码示例来源:origin: square/assertj-android

public S hasMinimumHeight(int height) {
 isNotNull();
 int actualHeight = actual.getMinimumHeight();
 assertThat(actualHeight) //
   .overridingErrorMessage("Expected minimum height <%s> but was <%s>.", height,
     actualHeight) //
   .isEqualTo(height);
 return myself;
}

代码示例来源:origin: smuyyh/BookReader

@Override
public void convert(EasyLVHolder holder, int position, BookMixAToc.mixToc.Chapters chapters) {
  TextView tvTocItem = holder.getView(R.id.tvTocItem);
  tvTocItem.setText(chapters.title);
  Drawable drawable;
  if (currentChapter == position + 1) {
    tvTocItem.setTextColor(ContextCompat.getColor(mContext, R.color.light_red));
    drawable = ContextCompat.getDrawable(mContext, R.drawable.ic_toc_item_activated);
  } else if (isEpub || FileUtils.getChapterFile(bookId, position + 1).length() > 10) {
    tvTocItem.setTextColor(ContextCompat.getColor(mContext, R.color.light_black));
    drawable = ContextCompat.getDrawable(mContext, R.drawable.ic_toc_item_download);
  } else {
    tvTocItem.setTextColor(ContextCompat.getColor(mContext, R.color.light_black));
    drawable = ContextCompat.getDrawable(mContext, R.drawable.ic_toc_item_normal);
  }
  drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
  tvTocItem.setCompoundDrawables(drawable, null, null, null);
}

代码示例来源:origin: bm-x/PhotoView

private boolean hasSize(Drawable d) {
  if ((d.getIntrinsicHeight() <= 0 || d.getIntrinsicWidth() <= 0)
      && (d.getMinimumWidth() <= 0 || d.getMinimumHeight() <= 0)
      && (d.getBounds().width() <= 0 || d.getBounds().height() <= 0)) {
    return false;
  }
  return true;
}

代码示例来源:origin: Hitomis/transferee

private boolean hasSize(Drawable d) {
  if ((d.getIntrinsicHeight() <= 0 || d.getIntrinsicWidth() <= 0)
      && (d.getMinimumWidth() <= 0 || d.getMinimumHeight() <= 0)
      && (d.getBounds().width() <= 0 || d.getBounds().height() <= 0)) {
    return false;
  }
  return true;
}

代码示例来源:origin: DreaminginCodeZH/MaterialProgressBar

@Override
public int getMinimumHeight() {
  if (mDrawableContainerState.isConstantSize()) {
    return mDrawableContainerState.getConstantMinimumHeight();
  }
  return mCurrDrawable != null ? mCurrDrawable.getMinimumHeight() : 0;
}

代码示例来源:origin: eleme/UETool

private void updateCustomView() {
    final CustomView customView = findViewById(R.id.custom);
    customView.setMoreAttribution("more attribution");
    Drawable drawable = ContextCompat.getDrawable(this, R.drawable.ic_up_vote);
    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
    customView.setCompoundDrawables(null, drawable, null, null);
  }
}

代码示例来源:origin: lygttpod/SuperTextView

/**
 * 设置中间view的drawableBottom
 *
 * @param drawableBottom 资源
 * @return 返回
 */
public CommonTextView setCenterDrawableBottom(Drawable drawableBottom) {
  if (drawableBottom != null) {
    drawableBottom.setBounds(0, 0, drawableBottom.getMinimumWidth(), drawableBottom.getMinimumHeight());
  }
  if (centerTextView == null) {
    initCenterText();
  }
  centerTextView.setCompoundDrawables(null, null, null, drawableBottom);
  return this;
}

代码示例来源:origin: robolectric/robolectric

@Test
public void getDrawable_mipmapReferencesResolve() {
 Drawable reference = resources.getDrawable(R.mipmap.mipmap_reference);
 Drawable original = resources.getDrawable(R.mipmap.robolectric);
 assertThat(reference.getMinimumHeight()).isEqualTo(original.getMinimumHeight());
 assertThat(reference.getMinimumWidth()).isEqualTo(original.getMinimumWidth());
}

代码示例来源:origin: robolectric/robolectric

@Test
@SdkSuppress(minSdkVersion = Build.VERSION_CODES.O)
@Config(minSdk = Build.VERSION_CODES.O)
public void getDrawable_mipmapReferencesResolveXml() {
 Drawable reference = resources.getDrawable(R.mipmap.robolectric_xml);
 Drawable original = resources.getDrawable(R.mipmap.mipmap_reference_xml);
 assertThat(reference.getMinimumHeight()).isEqualTo(original.getMinimumHeight());
 assertThat(reference.getMinimumWidth()).isEqualTo(original.getMinimumWidth());
}

相关文章