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

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

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

Drawable.resolveOpacity介绍

暂无

代码示例

代码示例来源:origin: ZieIony/Carbon

final Drawable dr = array[i].mDrawable;
if (dr != null) {
  op = Drawable.resolveOpacity(op, dr.getOpacity());

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

/**
 * @return the resolved opacity of all child drawables.
 */
public final int getOpacity() {
  if (mCheckedOpacity) {
    return mOpacity;
  }
  createAllFutures();
  final int count = mNumChildren;
  final Drawable[] drawables = mDrawables;
  int op = (count > 0) ? drawables[0].getOpacity() : PixelFormat.TRANSPARENT;
  for (int i = 1; i < count; i++) {
    op = Drawable.resolveOpacity(op, drawables[i].getOpacity());
  }
  mOpacity = op;
  mCheckedOpacity = true;
  return op;
}

代码示例来源:origin: AlexMofer/ProjectX

@Override
public int getOpacity() {
  if (mItems.isEmpty())
    return PixelFormat.TRANSPARENT;
  int op = mItems.get(0).getDrawable().getOpacity();
  final int count = mItems.size();
  for (int i = 1; i < count; i++) {
    op = Drawable.resolveOpacity(op, mItems.get(i).getDrawable().getOpacity());
  }
  return op;
}

代码示例来源:origin: PrivacyApps/document-viewer

public final int getOpacity() {
  if (mHaveOpacity) {
    return mOpacity;
  }
  final int N = mNum;
  final Rec[] array = mArray;
  int op = N > 0 ? array[0].mDrawable.getOpacity() : PixelFormat.TRANSPARENT;
  for (int i = 1; i < N; i++) {
    op = Drawable.resolveOpacity(op, array[i].mDrawable.getOpacity());
  }
  mOpacity = op;
  mHaveOpacity = true;
  return op;
}

相关文章