本文整理匯總了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;
}