本文整理汇总了Java中android.graphics.PorterDuff.Mode.MULTIPLY属性的典型用法代码示例。如果您正苦于以下问题:Java Mode.MULTIPLY属性的具体用法?Java Mode.MULTIPLY怎么用?Java Mode.MULTIPLY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.graphics.PorterDuff.Mode
的用法示例。
在下文中一共展示了Mode.MULTIPLY属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseTintMode
static Mode parseTintMode(int value, Mode defaultMode) {
switch (value) {
case 3:
return Mode.SRC_OVER;
case 5:
return Mode.SRC_IN;
case 9:
return Mode.SRC_ATOP;
case 14:
return Mode.MULTIPLY;
case 15:
return Mode.SCREEN;
case 16:
if (VERSION.SDK_INT >= 11) {
return Mode.valueOf("ADD");
}
return defaultMode;
default:
return defaultMode;
}
}
示例2: parseTintModeCompat
private static Mode parseTintModeCompat(int value, Mode defaultMode) {
switch (value) {
case 3:
return Mode.SRC_OVER;
case 5:
return Mode.SRC_IN;
case 9:
return Mode.SRC_ATOP;
case 14:
return Mode.MULTIPLY;
case 15:
return Mode.SCREEN;
case 16:
return Mode.ADD;
default:
return defaultMode;
}
}
示例3: parseTintMode
static Mode parseTintMode(int value, Mode defaultMode) {
switch (value) {
case 3:
return Mode.SRC_OVER;
case 5:
return Mode.SRC_IN;
case 9:
return Mode.SRC_ATOP;
case 14:
return Mode.MULTIPLY;
case 15:
return Mode.SCREEN;
default:
return defaultMode;
}
}
示例4: tintDrawableUsingColorFilter
private static boolean tintDrawableUsingColorFilter(@NonNull Context context, @DrawableRes int resId, @NonNull Drawable drawable) {
Mode tintMode = DEFAULT_MODE;
boolean colorAttrSet = false;
int colorAttr = 0;
int alpha = -1;
if (arrayContains(COLORFILTER_TINT_COLOR_CONTROL_NORMAL, resId)) {
colorAttr = R.attr.colorControlNormal;
colorAttrSet = true;
} else if (arrayContains(COLORFILTER_COLOR_CONTROL_ACTIVATED, resId)) {
colorAttr = R.attr.colorControlActivated;
colorAttrSet = true;
} else if (arrayContains(COLORFILTER_COLOR_BACKGROUND_MULTIPLY, resId)) {
colorAttr = 16842801;
colorAttrSet = true;
tintMode = Mode.MULTIPLY;
} else if (resId == R.drawable.abc_list_divider_mtrl_alpha) {
colorAttr = 16842800;
colorAttrSet = true;
alpha = Math.round(40.8f);
}
if (!colorAttrSet) {
return false;
}
if (DrawableUtils.canSafelyMutateDrawable(drawable)) {
drawable = drawable.mutate();
}
drawable.setColorFilter(getPorterDuffColorFilter(ThemeUtils.getThemeAttrColor(context, colorAttr), tintMode));
if (alpha != -1) {
drawable.setAlpha(alpha);
}
return true;
}
示例5: getTintMode
final Mode getTintMode(int resId) {
if (resId == R.drawable.abc_switch_thumb_material) {
return Mode.MULTIPLY;
}
return null;
}