diff --git a/api/current.txt b/api/current.txt index b434776a44038..dc249ebde9a41 100644 --- a/api/current.txt +++ b/api/current.txt @@ -13791,7 +13791,7 @@ package android.graphics { method public void drawCircle(float, float, float, @NonNull android.graphics.Paint); method public void drawColor(@ColorInt int); method public void drawColor(@ColorLong long); - method @Deprecated public void drawColor(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode); + method public void drawColor(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode); method public void drawColor(@ColorInt int, @NonNull android.graphics.BlendMode); method public void drawColor(@ColorLong long, @NonNull android.graphics.BlendMode); method public void drawDoubleRoundRect(@NonNull android.graphics.RectF, float, float, @NonNull android.graphics.RectF, float, float, @NonNull android.graphics.Paint); @@ -14108,7 +14108,7 @@ package android.graphics { public class ComposeShader extends android.graphics.Shader { ctor @Deprecated public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.Xfermode); - ctor @Deprecated public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.PorterDuff.Mode); + ctor public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.PorterDuff.Mode); ctor public ComposeShader(@NonNull android.graphics.Shader, @NonNull android.graphics.Shader, @NonNull android.graphics.BlendMode); } @@ -14497,7 +14497,7 @@ package android.graphics { method @Px public float getUnderlinePosition(); method @Px public float getUnderlineThickness(); method @Px public float getWordSpacing(); - method @Deprecated public android.graphics.Xfermode getXfermode(); + method public android.graphics.Xfermode getXfermode(); method public boolean hasGlyph(String); method public final boolean isAntiAlias(); method public final boolean isDither(); @@ -14554,7 +14554,7 @@ package android.graphics { method public android.graphics.Typeface setTypeface(android.graphics.Typeface); method public void setUnderlineText(boolean); method public void setWordSpacing(@Px float); - method @Deprecated public android.graphics.Xfermode setXfermode(android.graphics.Xfermode); + method public android.graphics.Xfermode setXfermode(android.graphics.Xfermode); field public static final int ANTI_ALIAS_FLAG = 1; // 0x1 field public static final int CURSOR_AFTER = 0; // 0x0 field public static final int CURSOR_AT = 4; // 0x4 @@ -14803,37 +14803,37 @@ package android.graphics { field public float y; } - @Deprecated public class PorterDuff { - ctor @Deprecated public PorterDuff(); + public class PorterDuff { + ctor public PorterDuff(); } - @Deprecated public enum PorterDuff.Mode { - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode ADD; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode CLEAR; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DARKEN; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_ATOP; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_IN; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_OUT; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode DST_OVER; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode LIGHTEN; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode MULTIPLY; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode OVERLAY; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SCREEN; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_ATOP; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_IN; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_OUT; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode SRC_OVER; - enum_constant @Deprecated public static final android.graphics.PorterDuff.Mode XOR; + public enum PorterDuff.Mode { + enum_constant public static final android.graphics.PorterDuff.Mode ADD; + enum_constant public static final android.graphics.PorterDuff.Mode CLEAR; + enum_constant public static final android.graphics.PorterDuff.Mode DARKEN; + enum_constant public static final android.graphics.PorterDuff.Mode DST; + enum_constant public static final android.graphics.PorterDuff.Mode DST_ATOP; + enum_constant public static final android.graphics.PorterDuff.Mode DST_IN; + enum_constant public static final android.graphics.PorterDuff.Mode DST_OUT; + enum_constant public static final android.graphics.PorterDuff.Mode DST_OVER; + enum_constant public static final android.graphics.PorterDuff.Mode LIGHTEN; + enum_constant public static final android.graphics.PorterDuff.Mode MULTIPLY; + enum_constant public static final android.graphics.PorterDuff.Mode OVERLAY; + enum_constant public static final android.graphics.PorterDuff.Mode SCREEN; + enum_constant public static final android.graphics.PorterDuff.Mode SRC; + enum_constant public static final android.graphics.PorterDuff.Mode SRC_ATOP; + enum_constant public static final android.graphics.PorterDuff.Mode SRC_IN; + enum_constant public static final android.graphics.PorterDuff.Mode SRC_OUT; + enum_constant public static final android.graphics.PorterDuff.Mode SRC_OVER; + enum_constant public static final android.graphics.PorterDuff.Mode XOR; } - @Deprecated public class PorterDuffColorFilter extends android.graphics.ColorFilter { - ctor @Deprecated public PorterDuffColorFilter(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode); + public class PorterDuffColorFilter extends android.graphics.ColorFilter { + ctor public PorterDuffColorFilter(@ColorInt int, @NonNull android.graphics.PorterDuff.Mode); } - @Deprecated public class PorterDuffXfermode extends android.graphics.Xfermode { - ctor @Deprecated public PorterDuffXfermode(android.graphics.PorterDuff.Mode); + public class PorterDuffXfermode extends android.graphics.Xfermode { + ctor public PorterDuffXfermode(android.graphics.PorterDuff.Mode); } public interface PostProcessor { @@ -15394,9 +15394,9 @@ package android.graphics.drawable { method public final boolean setLevel(@IntRange(from=0, to=10000) int); method public boolean setState(@NonNull int[]); method public void setTint(@ColorInt int); + method public void setTintBlendMode(@Nullable android.graphics.BlendMode); method public void setTintList(@Nullable android.content.res.ColorStateList); - method @Deprecated public void setTintMode(@Nullable android.graphics.PorterDuff.Mode); - method public void setTintMode(@Nullable android.graphics.BlendMode); + method public void setTintMode(@Nullable android.graphics.PorterDuff.Mode); method public boolean setVisible(boolean, boolean); method public void unscheduleSelf(@NonNull Runnable); } @@ -15553,9 +15553,9 @@ package android.graphics.drawable { method public void loadDrawableAsync(android.content.Context, android.os.Message); method public void loadDrawableAsync(android.content.Context, android.graphics.drawable.Icon.OnDrawableLoadedListener, android.os.Handler); method public android.graphics.drawable.Icon setTint(@ColorInt int); + method @NonNull public android.graphics.drawable.Icon setTintBlendMode(@NonNull android.graphics.BlendMode); method public android.graphics.drawable.Icon setTintList(android.content.res.ColorStateList); - method @Deprecated @NonNull public android.graphics.drawable.Icon setTintMode(@NonNull android.graphics.PorterDuff.Mode); - method @NonNull public android.graphics.drawable.Icon setTintMode(@NonNull android.graphics.BlendMode); + method @NonNull public android.graphics.drawable.Icon setTintMode(@NonNull android.graphics.PorterDuff.Mode); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator CREATOR; field public static final int TYPE_ADAPTIVE_BITMAP = 5; // 0x5 @@ -49453,7 +49453,7 @@ package android.view { method public android.graphics.drawable.Drawable getIcon(); method @Nullable public default android.graphics.BlendMode getIconTintBlendMode(); method @Nullable public default android.content.res.ColorStateList getIconTintList(); - method @Deprecated @Nullable public default android.graphics.PorterDuff.Mode getIconTintMode(); + method @Nullable public default android.graphics.PorterDuff.Mode getIconTintMode(); method public android.content.Intent getIntent(); method public int getItemId(); method public android.view.ContextMenu.ContextMenuInfo getMenuInfo(); @@ -49481,9 +49481,9 @@ package android.view { method public android.view.MenuItem setEnabled(boolean); method public android.view.MenuItem setIcon(android.graphics.drawable.Drawable); method public android.view.MenuItem setIcon(@DrawableRes int); + method @NonNull public default android.view.MenuItem setIconTintBlendMode(@Nullable android.graphics.BlendMode); method public default android.view.MenuItem setIconTintList(@Nullable android.content.res.ColorStateList); - method @Deprecated @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.PorterDuff.Mode); - method @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.BlendMode); + method @NonNull public default android.view.MenuItem setIconTintMode(@Nullable android.graphics.PorterDuff.Mode); method public android.view.MenuItem setIntent(android.content.Intent); method public android.view.MenuItem setNumericShortcut(char); method public default android.view.MenuItem setNumericShortcut(char, int); @@ -50136,9 +50136,9 @@ package android.view { method public int getAutofillType(); method @Nullable public android.view.autofill.AutofillValue getAutofillValue(); method public android.graphics.drawable.Drawable getBackground(); - method @Nullable public android.graphics.BlendMode getBackgroundBlendMode(); + method @Nullable public android.graphics.BlendMode getBackgroundTintBlendMode(); method @Nullable public android.content.res.ColorStateList getBackgroundTintList(); - method @Deprecated @Nullable public android.graphics.PorterDuff.Mode getBackgroundTintMode(); + method @Nullable public android.graphics.PorterDuff.Mode getBackgroundTintMode(); method @android.view.ViewDebug.ExportedProperty(category="layout") public int getBaseline(); method @android.view.ViewDebug.CapturedViewProperty public final int getBottom(); method protected float getBottomFadingEdgeStrength(); @@ -50169,10 +50169,10 @@ package android.view { method public java.util.ArrayList getFocusables(int); method public void getFocusedRect(android.graphics.Rect); method public android.graphics.drawable.Drawable getForeground(); - method @Nullable public android.graphics.BlendMode getForegroundBlendMode(); method public int getForegroundGravity(); + method @Nullable public android.graphics.BlendMode getForegroundTintBlendMode(); method @Nullable public android.content.res.ColorStateList getForegroundTintList(); - method @Deprecated @Nullable public android.graphics.PorterDuff.Mode getForegroundTintMode(); + method @Nullable public android.graphics.PorterDuff.Mode getForegroundTintMode(); method public boolean getGlobalVisibleRect(android.graphics.Rect, android.graphics.Point); method public final boolean getGlobalVisibleRect(android.graphics.Rect); method public android.os.Handler getHandler(); @@ -50484,9 +50484,9 @@ package android.view { method public void setBackgroundColor(@ColorInt int); method @Deprecated public void setBackgroundDrawable(android.graphics.drawable.Drawable); method public void setBackgroundResource(@DrawableRes int); + method public void setBackgroundTintBlendMode(@Nullable android.graphics.BlendMode); method public void setBackgroundTintList(@Nullable android.content.res.ColorStateList); - method @Deprecated public void setBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode); - method public void setBackgroundTintMode(@Nullable android.graphics.BlendMode); + method public void setBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode); method public final void setBottom(int); method public void setCameraDistance(float); method public void setClickable(boolean); @@ -50512,9 +50512,9 @@ package android.view { method public void setForceDarkAllowed(boolean); method public void setForeground(android.graphics.drawable.Drawable); method public void setForegroundGravity(int); + method public void setForegroundTintBlendMode(@Nullable android.graphics.BlendMode); method public void setForegroundTintList(@Nullable android.content.res.ColorStateList); - method @Deprecated public void setForegroundTintMode(@Nullable android.graphics.PorterDuff.Mode); - method public void setForegroundTintMode(@Nullable android.graphics.BlendMode); + method public void setForegroundTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setHapticFeedbackEnabled(boolean); method public void setHasTransientState(boolean); method public void setHorizontalFadingEdgeEnabled(boolean); @@ -54850,18 +54850,22 @@ package android.widget { method public boolean getSplitTrack(); method public android.graphics.drawable.Drawable getThumb(); method public int getThumbOffset(); + method @Nullable public android.graphics.BlendMode getThumbTintBlendMode(); method @Nullable public android.content.res.ColorStateList getThumbTintList(); method @Nullable public android.graphics.PorterDuff.Mode getThumbTintMode(); method public android.graphics.drawable.Drawable getTickMark(); + method @Nullable public android.graphics.BlendMode getTickMarkTintBlendMode(); method @Nullable public android.content.res.ColorStateList getTickMarkTintList(); method @Nullable public android.graphics.PorterDuff.Mode getTickMarkTintMode(); method public void setKeyProgressIncrement(int); method public void setSplitTrack(boolean); method public void setThumb(android.graphics.drawable.Drawable); method public void setThumbOffset(int); + method public void setThumbTintBlendMode(@Nullable android.graphics.BlendMode); method public void setThumbTintList(@Nullable android.content.res.ColorStateList); method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setTickMark(android.graphics.drawable.Drawable); + method public void setTickMarkTintBlendMode(@Nullable android.graphics.BlendMode); method public void setTickMarkTintList(@Nullable android.content.res.ColorStateList); method public void setTickMarkTintMode(@Nullable android.graphics.PorterDuff.Mode); } @@ -55260,11 +55264,13 @@ package android.widget { ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int); ctor public CheckedTextView(android.content.Context, android.util.AttributeSet, int, int); method public android.graphics.drawable.Drawable getCheckMarkDrawable(); + method @Nullable public android.graphics.BlendMode getCheckMarkTintBlendMode(); method @Nullable public android.content.res.ColorStateList getCheckMarkTintList(); method @Nullable public android.graphics.PorterDuff.Mode getCheckMarkTintMode(); method @android.view.ViewDebug.ExportedProperty public boolean isChecked(); method public void setCheckMarkDrawable(@DrawableRes int); method public void setCheckMarkDrawable(@Nullable android.graphics.drawable.Drawable); + method public void setCheckMarkTintBlendMode(@Nullable android.graphics.BlendMode); method public void setCheckMarkTintList(@Nullable android.content.res.ColorStateList); method public void setCheckMarkTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setChecked(boolean); @@ -55299,11 +55305,13 @@ package android.widget { ctor public CompoundButton(android.content.Context, android.util.AttributeSet, int); ctor public CompoundButton(android.content.Context, android.util.AttributeSet, int, int); method @Nullable public android.graphics.drawable.Drawable getButtonDrawable(); + method @Nullable public android.graphics.BlendMode getButtonTintBlendMode(); method @Nullable public android.content.res.ColorStateList getButtonTintList(); method @Nullable public android.graphics.PorterDuff.Mode getButtonTintMode(); method @android.view.ViewDebug.ExportedProperty public boolean isChecked(); method public void setButtonDrawable(@DrawableRes int); method public void setButtonDrawable(@Nullable android.graphics.drawable.Drawable); + method public void setButtonTintBlendMode(@Nullable android.graphics.BlendMode); method public void setButtonTintList(@Nullable android.content.res.ColorStateList); method public void setButtonTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setChecked(boolean); @@ -55792,6 +55800,7 @@ package android.widget { method public android.graphics.drawable.Drawable getDrawable(); method public int getImageAlpha(); method public android.graphics.Matrix getImageMatrix(); + method @Nullable public android.graphics.BlendMode getImageTintBlendMode(); method @Nullable public android.content.res.ColorStateList getImageTintList(); method @Nullable public android.graphics.PorterDuff.Mode getImageTintMode(); method public int getMaxHeight(); @@ -55815,6 +55824,7 @@ package android.widget { method public void setImageMatrix(android.graphics.Matrix); method public void setImageResource(@DrawableRes int); method public void setImageState(int[], boolean); + method public void setImageTintBlendMode(@Nullable android.graphics.BlendMode); method public void setImageTintList(@Nullable android.content.res.ColorStateList); method public void setImageTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setImageURI(@Nullable android.net.Uri); @@ -56268,6 +56278,7 @@ package android.widget { ctor public ProgressBar(android.content.Context, android.util.AttributeSet, int, int); method @Nullable public android.graphics.drawable.Drawable getCurrentDrawable(); method public android.graphics.drawable.Drawable getIndeterminateDrawable(); + method @Nullable public android.graphics.BlendMode getIndeterminateTintBlendMode(); method @Nullable public android.content.res.ColorStateList getIndeterminateTintList(); method @Nullable public android.graphics.PorterDuff.Mode getIndeterminateTintMode(); method public android.view.animation.Interpolator getInterpolator(); @@ -56278,12 +56289,15 @@ package android.widget { method @Px public int getMinHeight(); method @Px public int getMinWidth(); method @android.view.ViewDebug.ExportedProperty(category="progress") public int getProgress(); + method @Nullable public android.graphics.BlendMode getProgressBackgroundTintBlendMode(); method @Nullable public android.content.res.ColorStateList getProgressBackgroundTintList(); method @Nullable public android.graphics.PorterDuff.Mode getProgressBackgroundTintMode(); method public android.graphics.drawable.Drawable getProgressDrawable(); + method @Nullable public android.graphics.BlendMode getProgressTintBlendMode(); method @Nullable public android.content.res.ColorStateList getProgressTintList(); method @Nullable public android.graphics.PorterDuff.Mode getProgressTintMode(); method @android.view.ViewDebug.ExportedProperty(category="progress") public int getSecondaryProgress(); + method @Nullable public android.graphics.BlendMode getSecondaryProgressTintBlendMode(); method @Nullable public android.content.res.ColorStateList getSecondaryProgressTintList(); method @Nullable public android.graphics.PorterDuff.Mode getSecondaryProgressTintMode(); method public final void incrementProgressBy(int); @@ -56295,6 +56309,7 @@ package android.widget { method public void setIndeterminate(boolean); method public void setIndeterminateDrawable(android.graphics.drawable.Drawable); method public void setIndeterminateDrawableTiled(android.graphics.drawable.Drawable); + method public void setIndeterminateTintBlendMode(@Nullable android.graphics.BlendMode); method public void setIndeterminateTintList(@Nullable android.content.res.ColorStateList); method public void setIndeterminateTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setInterpolator(android.content.Context, @InterpolatorRes int); @@ -56307,13 +56322,16 @@ package android.widget { method public void setMinWidth(@Px int); method public void setProgress(int); method public void setProgress(int, boolean); + method public void setProgressBackgroundTintBlendMode(@Nullable android.graphics.BlendMode); method public void setProgressBackgroundTintList(@Nullable android.content.res.ColorStateList); method public void setProgressBackgroundTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setProgressDrawable(android.graphics.drawable.Drawable); method public void setProgressDrawableTiled(android.graphics.drawable.Drawable); + method public void setProgressTintBlendMode(@Nullable android.graphics.BlendMode); method public void setProgressTintList(@Nullable android.content.res.ColorStateList); method public void setProgressTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setSecondaryProgress(int); + method public void setSecondaryProgressTintBlendMode(@Nullable android.graphics.BlendMode); method public void setSecondaryProgressTintList(@Nullable android.content.res.ColorStateList); method public void setSecondaryProgressTintMode(@Nullable android.graphics.PorterDuff.Mode); } @@ -56862,9 +56880,11 @@ package android.widget { method public CharSequence getTextOn(); method public android.graphics.drawable.Drawable getThumbDrawable(); method public int getThumbTextPadding(); + method @Nullable public android.graphics.BlendMode getThumbTintBlendMode(); method @Nullable public android.content.res.ColorStateList getThumbTintList(); method @Nullable public android.graphics.PorterDuff.Mode getThumbTintMode(); method public android.graphics.drawable.Drawable getTrackDrawable(); + method @Nullable public android.graphics.BlendMode getTrackTintBlendMode(); method @Nullable public android.content.res.ColorStateList getTrackTintList(); method @Nullable public android.graphics.PorterDuff.Mode getTrackTintMode(); method public void onMeasure(int, int); @@ -56880,10 +56900,12 @@ package android.widget { method public void setThumbDrawable(android.graphics.drawable.Drawable); method public void setThumbResource(@DrawableRes int); method public void setThumbTextPadding(int); + method public void setThumbTintBlendMode(@Nullable android.graphics.BlendMode); method public void setThumbTintList(@Nullable android.content.res.ColorStateList); method public void setThumbTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setTrackDrawable(android.graphics.drawable.Drawable); method public void setTrackResource(@DrawableRes int); + method public void setTrackTintBlendMode(@Nullable android.graphics.BlendMode); method public void setTrackTintList(@Nullable android.content.res.ColorStateList); method public void setTrackTintMode(@Nullable android.graphics.PorterDuff.Mode); } @@ -57041,6 +57063,7 @@ package android.widget { method public int getAutoSizeTextType(); method public int getBreakStrategy(); method public int getCompoundDrawablePadding(); + method @Nullable public android.graphics.BlendMode getCompoundDrawableTintBlendMode(); method public android.content.res.ColorStateList getCompoundDrawableTintList(); method public android.graphics.PorterDuff.Mode getCompoundDrawableTintMode(); method @NonNull public android.graphics.drawable.Drawable[] getCompoundDrawables(); @@ -57166,6 +57189,7 @@ package android.widget { method public void setAutoSizeTextTypeWithDefaults(int); method public void setBreakStrategy(int); method public void setCompoundDrawablePadding(int); + method public void setCompoundDrawableTintBlendMode(@Nullable android.graphics.BlendMode); method public void setCompoundDrawableTintList(@Nullable android.content.res.ColorStateList); method public void setCompoundDrawableTintMode(@Nullable android.graphics.PorterDuff.Mode); method public void setCompoundDrawables(@Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable, @Nullable android.graphics.drawable.Drawable); diff --git a/core/java/android/view/MenuInflater.java b/core/java/android/view/MenuInflater.java index 8b3b10f48a4a0..b6b11ab9249ba 100644 --- a/core/java/android/view/MenuInflater.java +++ b/core/java/android/view/MenuInflater.java @@ -488,7 +488,7 @@ public class MenuInflater { } if (mItemIconBlendMode != null) { - item.setIconTintMode(mItemIconBlendMode); + item.setIconTintBlendMode(mItemIconBlendMode); } if (itemIconTintList != null) { diff --git a/core/java/android/view/MenuItem.java b/core/java/android/view/MenuItem.java index 37853103ce02f..a2fb596f743ee 100644 --- a/core/java/android/view/MenuItem.java +++ b/core/java/android/view/MenuItem.java @@ -270,11 +270,8 @@ public interface MenuItem { * @attr ref android.R.styleable#MenuItem_iconTintMode * @see #setIconTintList(ColorStateList) * @see Drawable#setTintMode(PorterDuff.Mode) - * @see Drawable#setTintMode(BlendMode) - * - * @deprecated use {@link #setIconTintMode(BlendMode)} instead + * @see Drawable#setTintBlendMode(BlendMode) */ - @Deprecated default @NonNull MenuItem setIconTintMode(@Nullable PorterDuff.Mode tintMode) { return this; } @@ -289,7 +286,7 @@ public interface MenuItem { * @attr ref android.R.styleable#MenuItem_iconTintMode * @see #setIconTintList(ColorStateList) */ - default @NonNull MenuItem setIconTintMode(@Nullable BlendMode blendMode) { + default @NonNull MenuItem setIconTintBlendMode(@Nullable BlendMode blendMode) { PorterDuff.Mode mode = BlendMode.blendModeToPorterDuffMode(blendMode); if (mode != null) { return setIconTintMode(mode); @@ -304,11 +301,9 @@ public interface MenuItem { * @return the blending mode used to apply the tint to this item's icon * @attr ref android.R.styleable#MenuItem_iconTintMode * @see #setIconTintMode(PorterDuff.Mode) - * @see #setIconTintMode(BlendMode) + * @see #setIconTintBlendMode(BlendMode) * - * @deprecated Use {@link #getIconTintBlendMode()} instead */ - @Deprecated @Nullable public default PorterDuff.Mode getIconTintMode() { return null; } @@ -317,7 +312,7 @@ public interface MenuItem { * * @return the blending mode used to apply the tint to this item's icon * @attr ref android.R.styleable#MenuItem_iconTintMode - * @see #setIconTintMode(BlendMode) + * @see #setIconTintBlendMode(BlendMode) * */ @Nullable diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index 096c988c8cf1f..10f9d38c3c668 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -5608,7 +5608,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, break; case R.styleable.View_foregroundTintMode: if (targetSdkVersion >= Build.VERSION_CODES.M || this instanceof FrameLayout) { - setForegroundTintMode(Drawable.parseBlendMode(a.getInt(attr, -1), null)); + setForegroundTintBlendMode( + Drawable.parseBlendMode(a.getInt(attr, -1), + null)); } break; case R.styleable.View_foregroundTint: @@ -22873,17 +22875,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @attr ref android.R.styleable#View_backgroundTintMode * @see #getBackgroundTintMode() * @see Drawable#setTintMode(PorterDuff.Mode) - * - * @deprecated use @setBackgroundTintMode(BlendMode) instead */ - @Deprecated public void setBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) { BlendMode mode = null; if (tintMode != null) { mode = BlendMode.fromValue(tintMode.nativeInt); } - setBackgroundTintMode(mode); + setBackgroundTintBlendMode(mode); } /** @@ -22895,9 +22894,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@code null} to clear tint * @attr ref android.R.styleable#View_backgroundTintMode * @see #getBackgroundTintMode() - * @see Drawable#setTintMode(BlendMode) + * @see Drawable#setTintBlendMode(BlendMode) */ - public void setBackgroundTintMode(@Nullable BlendMode blendMode) { + public void setBackgroundTintBlendMode(@Nullable BlendMode blendMode) { if (mBackgroundTint == null) { mBackgroundTint = new TintInfo(); } @@ -22915,13 +22914,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return the blending mode used to apply the tint to the background * drawable * @attr ref android.R.styleable#View_backgroundTintMode - * @see #setBackgroundTintMode(BlendMode) + * @see #setBackgroundTintBlendMode(BlendMode) * - * @deprecated use #getBackgroundBlendMode() instead */ @Nullable @InspectableProperty - @Deprecated public PorterDuff.Mode getBackgroundTintMode() { PorterDuff.Mode porterDuffMode; if (mBackgroundTint != null && mBackgroundTint.mBlendMode != null) { @@ -22939,9 +22936,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return the blending mode used to apply the tint to the background * drawable, null if no blend has previously been configured * @attr ref android.R.styleable#View_backgroundTintMode - * @see #setBackgroundTintMode(BlendMode) + * @see #setBackgroundTintBlendMode(BlendMode) */ - public @Nullable BlendMode getBackgroundBlendMode() { + public @Nullable BlendMode getBackgroundTintBlendMode() { return mBackgroundTint != null ? mBackgroundTint.mBlendMode : null; } @@ -22956,7 +22953,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } if (tintInfo.mHasTintMode) { - mBackground.setTintMode(tintInfo.mBlendMode); + mBackground.setTintBlendMode(tintInfo.mBlendMode); } // The drawable (or one of its children) may not have been @@ -23141,15 +23138,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @see #getForegroundTintMode() * @see Drawable#setTintMode(PorterDuff.Mode) * - * @deprecated use #setForegroundTintMode(BlendMode) */ - @Deprecated public void setForegroundTintMode(@Nullable PorterDuff.Mode tintMode) { BlendMode mode = null; if (tintMode != null) { mode = BlendMode.fromValue(tintMode.nativeInt); } - setForegroundTintMode(mode); + setForegroundTintBlendMode(mode); } /** @@ -23161,9 +23156,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * {@code null} to clear tint * @attr ref android.R.styleable#View_foregroundTintMode * @see #getForegroundTintMode() - * @see Drawable#setTintMode(BlendMode) + * @see Drawable#setTintBlendMode(BlendMode) */ - public void setForegroundTintMode(@Nullable BlendMode blendMode) { + public void setForegroundTintBlendMode(@Nullable BlendMode blendMode) { if (mForegroundInfo == null) { mForegroundInfo = new ForegroundInfo(); } @@ -23184,12 +23179,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * drawable * @attr ref android.R.styleable#View_foregroundTintMode * @see #setForegroundTintMode(PorterDuff.Mode) - * - * @deprecated use #getForegroundBlendMode() instead */ @InspectableProperty @Nullable - @Deprecated public PorterDuff.Mode getForegroundTintMode() { BlendMode blendMode = mForegroundInfo != null && mForegroundInfo.mTintInfo != null ? mForegroundInfo.mTintInfo.mBlendMode : null; @@ -23207,10 +23199,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @return the blending mode used to apply the tint to the foreground * drawable * @attr ref android.R.styleable#View_foregroundTintMode - * @see #setForegroundTintMode(BlendMode) + * @see #setForegroundTintBlendMode(BlendMode) * */ - public @Nullable BlendMode getForegroundBlendMode() { + public @Nullable BlendMode getForegroundTintBlendMode() { return mForegroundInfo != null && mForegroundInfo.mTintInfo != null ? mForegroundInfo.mTintInfo.mBlendMode : null; } @@ -23227,7 +23219,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, } if (tintInfo.mHasTintMode) { - mForegroundInfo.mDrawable.setTintMode(tintInfo.mBlendMode); + mForegroundInfo.mDrawable.setTintBlendMode(tintInfo.mBlendMode); } // The drawable (or one of its children) may not have been diff --git a/core/java/android/widget/AbsSeekBar.java b/core/java/android/widget/AbsSeekBar.java index cd5f2e222b398..18c6abb3f5f1b 100644 --- a/core/java/android/widget/AbsSeekBar.java +++ b/core/java/android/widget/AbsSeekBar.java @@ -22,6 +22,7 @@ import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.Insets; import android.graphics.PorterDuff; @@ -48,15 +49,15 @@ public abstract class AbsSeekBar extends ProgressBar { @UnsupportedAppUsage private Drawable mThumb; private ColorStateList mThumbTintList = null; - private PorterDuff.Mode mThumbTintMode = null; + private BlendMode mThumbBlendMode = null; private boolean mHasThumbTint = false; - private boolean mHasThumbTintMode = false; + private boolean mHasThumbBlendMode = false; private Drawable mTickMark; private ColorStateList mTickMarkTintList = null; - private PorterDuff.Mode mTickMarkTintMode = null; + private BlendMode mTickMarkBlendMode = null; private boolean mHasTickMarkTint = false; - private boolean mHasTickMarkTintMode = false; + private boolean mHasTickMarkBlendMode = false; private int mThumbOffset; @UnsupportedAppUsage @@ -114,9 +115,9 @@ public abstract class AbsSeekBar extends ProgressBar { setThumb(thumb); if (a.hasValue(R.styleable.SeekBar_thumbTintMode)) { - mThumbTintMode = Drawable.parseTintMode(a.getInt( - R.styleable.SeekBar_thumbTintMode, -1), mThumbTintMode); - mHasThumbTintMode = true; + mThumbBlendMode = Drawable.parseBlendMode(a.getInt( + R.styleable.SeekBar_thumbTintMode, -1), mThumbBlendMode); + mHasThumbBlendMode = true; } if (a.hasValue(R.styleable.SeekBar_thumbTint)) { @@ -128,9 +129,9 @@ public abstract class AbsSeekBar extends ProgressBar { setTickMark(tickMark); if (a.hasValue(R.styleable.SeekBar_tickMarkTintMode)) { - mTickMarkTintMode = Drawable.parseTintMode(a.getInt( - R.styleable.SeekBar_tickMarkTintMode, -1), mTickMarkTintMode); - mHasTickMarkTintMode = true; + mTickMarkBlendMode = Drawable.parseBlendMode(a.getInt( + R.styleable.SeekBar_tickMarkTintMode, -1), mTickMarkBlendMode); + mHasTickMarkBlendMode = true; } if (a.hasValue(R.styleable.SeekBar_tickMarkTint)) { @@ -274,9 +275,25 @@ public abstract class AbsSeekBar extends ProgressBar { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setThumbTintMode(@Nullable PorterDuff.Mode tintMode) { - mThumbTintMode = tintMode; - mHasThumbTintMode = true; + setThumbTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : + null); + } + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setThumbTintList(ColorStateList)}} to the thumb drawable. The + * default mode is {@link BlendMode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * + * @attr ref android.R.styleable#SeekBar_thumbTintMode + * @see #getThumbTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setThumbTintBlendMode(@Nullable BlendMode blendMode) { + mThumbBlendMode = blendMode; + mHasThumbBlendMode = true; applyThumbTint(); } @@ -291,19 +308,33 @@ public abstract class AbsSeekBar extends ProgressBar { @InspectableProperty @Nullable public PorterDuff.Mode getThumbTintMode() { - return mThumbTintMode; + return mThumbBlendMode != null + ? BlendMode.blendModeToPorterDuffMode(mThumbBlendMode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the thumb drawable, + * if specified. + * + * @return the blending mode used to apply the tint to the thumb drawable + * @attr ref android.R.styleable#SeekBar_thumbTintMode + * @see #setThumbTintBlendMode(BlendMode) + */ + @Nullable + public BlendMode getThumbTintBlendMode() { + return mThumbBlendMode; } private void applyThumbTint() { - if (mThumb != null && (mHasThumbTint || mHasThumbTintMode)) { + if (mThumb != null && (mHasThumbTint || mHasThumbBlendMode)) { mThumb = mThumb.mutate(); if (mHasThumbTint) { mThumb.setTintList(mThumbTintList); } - if (mHasThumbTintMode) { - mThumb.setTintMode(mThumbTintMode); + if (mHasThumbBlendMode) { + mThumb.setTintBlendMode(mThumbBlendMode); } // The drawable (or one of its children) may not have been @@ -430,8 +461,24 @@ public abstract class AbsSeekBar extends ProgressBar { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setTickMarkTintMode(@Nullable PorterDuff.Mode tintMode) { - mTickMarkTintMode = tintMode; - mHasTickMarkTintMode = true; + setTickMarkTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setTickMarkTintList(ColorStateList)}} to the tick mark drawable. The + * default mode is {@link BlendMode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * + * @attr ref android.R.styleable#SeekBar_tickMarkTintMode + * @see #getTickMarkTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setTickMarkTintBlendMode(@Nullable BlendMode blendMode) { + mTickMarkBlendMode = blendMode; + mHasTickMarkBlendMode = true; applyTickMarkTint(); } @@ -447,19 +494,34 @@ public abstract class AbsSeekBar extends ProgressBar { @InspectableProperty @Nullable public PorterDuff.Mode getTickMarkTintMode() { - return mTickMarkTintMode; + return mTickMarkBlendMode != null + ? BlendMode.blendModeToPorterDuffMode(mTickMarkBlendMode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the tick mark drawable, + * if specified. + * + * @return the blending mode used to apply the tint to the tick mark drawable + * @attr ref android.R.styleable#SeekBar_tickMarkTintMode + * @see #setTickMarkTintMode(PorterDuff.Mode) + */ + @InspectableProperty(attributeId = android.R.styleable.SeekBar_tickMarkTintMode) + @Nullable + public BlendMode getTickMarkTintBlendMode() { + return mTickMarkBlendMode; } private void applyTickMarkTint() { - if (mTickMark != null && (mHasTickMarkTint || mHasTickMarkTintMode)) { + if (mTickMark != null && (mHasTickMarkTint || mHasTickMarkBlendMode)) { mTickMark = mTickMark.mutate(); if (mHasTickMarkTint) { mTickMark.setTintList(mTickMarkTintList); } - if (mHasTickMarkTintMode) { - mTickMark.setTintMode(mTickMarkTintMode); + if (mHasTickMarkBlendMode) { + mTickMark.setTintBlendMode(mTickMarkBlendMode); } // The drawable (or one of its children) may not have been diff --git a/core/java/android/widget/CheckedTextView.java b/core/java/android/widget/CheckedTextView.java index a211b4686f4cd..8b70f41f050cd 100644 --- a/core/java/android/widget/CheckedTextView.java +++ b/core/java/android/widget/CheckedTextView.java @@ -23,6 +23,7 @@ import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; @@ -58,7 +59,7 @@ public class CheckedTextView extends TextView implements Checkable { @UnsupportedAppUsage private Drawable mCheckMarkDrawable; private ColorStateList mCheckMarkTintList = null; - private PorterDuff.Mode mCheckMarkTintMode = null; + private BlendMode mCheckMarkBlendMode = null; private boolean mHasCheckMarkTint = false; private boolean mHasCheckMarkTintMode = false; @@ -99,8 +100,9 @@ public class CheckedTextView extends TextView implements Checkable { } if (a.hasValue(R.styleable.CheckedTextView_checkMarkTintMode)) { - mCheckMarkTintMode = Drawable.parseTintMode(a.getInt( - R.styleable.CheckedTextView_checkMarkTintMode, -1), mCheckMarkTintMode); + mCheckMarkBlendMode = Drawable.parseBlendMode(a.getInt( + R.styleable.CheckedTextView_checkMarkTintMode, -1), + mCheckMarkBlendMode); mHasCheckMarkTintMode = true; } @@ -259,7 +261,23 @@ public class CheckedTextView extends TextView implements Checkable { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setCheckMarkTintMode(@Nullable PorterDuff.Mode tintMode) { - mCheckMarkTintMode = tintMode; + setCheckMarkTintBlendMode(tintMode != null + ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setCheckMarkTintList(ColorStateList)} to the check mark + * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}. + * + * @param tintMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#CheckedTextView_checkMarkTintMode + * @see #setCheckMarkTintList(ColorStateList) + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setCheckMarkTintBlendMode(@Nullable BlendMode tintMode) { + mCheckMarkBlendMode = tintMode; mHasCheckMarkTintMode = true; applyCheckMarkTint(); @@ -277,7 +295,23 @@ public class CheckedTextView extends TextView implements Checkable { @InspectableProperty @Nullable public PorterDuff.Mode getCheckMarkTintMode() { - return mCheckMarkTintMode; + return mCheckMarkBlendMode != null + ? BlendMode.blendModeToPorterDuffMode(mCheckMarkBlendMode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the check mark + * drawable, if specified. + * + * @return the blending mode used to apply the tint to the check mark + * drawable + * @attr ref android.R.styleable#CheckedTextView_checkMarkTintMode + * @see #setCheckMarkTintMode(PorterDuff.Mode) + */ + @InspectableProperty(attributeId = android.R.styleable.CheckedTextView_checkMarkTintMode) + @Nullable + public BlendMode getCheckMarkTintBlendMode() { + return mCheckMarkBlendMode; } private void applyCheckMarkTint() { @@ -289,7 +323,7 @@ public class CheckedTextView extends TextView implements Checkable { } if (mHasCheckMarkTintMode) { - mCheckMarkDrawable.setTintMode(mCheckMarkTintMode); + mCheckMarkDrawable.setTintBlendMode(mCheckMarkBlendMode); } // The drawable (or one of its children) may not have been diff --git a/core/java/android/widget/CompoundButton.java b/core/java/android/widget/CompoundButton.java index 80ec1c65293b5..2674ca4d159aa 100644 --- a/core/java/android/widget/CompoundButton.java +++ b/core/java/android/widget/CompoundButton.java @@ -23,6 +23,7 @@ import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.drawable.Drawable; @@ -67,9 +68,9 @@ public abstract class CompoundButton extends Button implements Checkable { @UnsupportedAppUsage private Drawable mButtonDrawable; private ColorStateList mButtonTintList = null; - private PorterDuff.Mode mButtonTintMode = null; + private BlendMode mButtonBlendMode = null; private boolean mHasButtonTint = false; - private boolean mHasButtonTintMode = false; + private boolean mHasButtonBlendMode = false; @UnsupportedAppUsage private OnCheckedChangeListener mOnCheckedChangeListener; @@ -109,9 +110,9 @@ public abstract class CompoundButton extends Button implements Checkable { } if (a.hasValue(R.styleable.CompoundButton_buttonTintMode)) { - mButtonTintMode = Drawable.parseTintMode(a.getInt( - R.styleable.CompoundButton_buttonTintMode, -1), mButtonTintMode); - mHasButtonTintMode = true; + mButtonBlendMode = Drawable.parseBlendMode(a.getInt( + R.styleable.CompoundButton_buttonTintMode, -1), mButtonBlendMode); + mHasButtonBlendMode = true; } if (a.hasValue(R.styleable.CompoundButton_buttonTint)) { @@ -337,8 +338,23 @@ public abstract class CompoundButton extends Button implements Checkable { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setButtonTintMode(@Nullable PorterDuff.Mode tintMode) { - mButtonTintMode = tintMode; - mHasButtonTintMode = true; + setButtonTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setButtonTintList(ColorStateList)}} to the button drawable. The + * default mode is {@link PorterDuff.Mode#SRC_IN}. + * + * @param tintMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#CompoundButton_buttonTintMode + * @see #getButtonTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setButtonTintBlendMode(@Nullable BlendMode tintMode) { + mButtonBlendMode = tintMode; + mHasButtonBlendMode = true; applyButtonTint(); } @@ -348,22 +364,35 @@ public abstract class CompoundButton extends Button implements Checkable { * @attr ref android.R.styleable#CompoundButton_buttonTintMode * @see #setButtonTintMode(PorterDuff.Mode) */ - @InspectableProperty + @InspectableProperty(name = "buttonTintMode") @Nullable public PorterDuff.Mode getButtonTintMode() { - return mButtonTintMode; + return mButtonBlendMode != null ? BlendMode.blendModeToPorterDuffMode(mButtonBlendMode) : + null; + } + + /** + * @return the blending mode used to apply the tint to the button drawable + * @attr ref android.R.styleable#CompoundButton_buttonTintMode + * @see #setButtonTintBlendMode(BlendMode) + */ + @InspectableProperty(name = "buttonBlendMode", + attributeId = R.styleable.CompoundButton_buttonTintMode) + @Nullable + public BlendMode getButtonTintBlendMode() { + return mButtonBlendMode; } private void applyButtonTint() { - if (mButtonDrawable != null && (mHasButtonTint || mHasButtonTintMode)) { + if (mButtonDrawable != null && (mHasButtonTint || mHasButtonBlendMode)) { mButtonDrawable = mButtonDrawable.mutate(); if (mHasButtonTint) { mButtonDrawable.setTintList(mButtonTintList); } - if (mHasButtonTintMode) { - mButtonDrawable.setTintMode(mButtonTintMode); + if (mHasButtonBlendMode) { + mButtonDrawable.setTintBlendMode(mButtonBlendMode); } // The drawable (or one of its children) may not have been diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 9ae62ef8ab7af..be5d2211c6700 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -27,6 +27,7 @@ import android.content.res.ColorStateList; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.ImageDecoder; @@ -127,9 +128,9 @@ public class ImageView extends View { @UnsupportedAppUsage private BitmapDrawable mRecycleableBitmapDrawable = null; private ColorStateList mDrawableTintList = null; - private PorterDuff.Mode mDrawableTintMode = null; + private BlendMode mDrawableBlendMode = null; private boolean mHasDrawableTint = false; - private boolean mHasDrawableTintMode = false; + private boolean mHasDrawableBlendMode = false; private int[] mState = null; private boolean mMergeState = false; @@ -226,14 +227,14 @@ public class ImageView extends View { // Prior to L, this attribute would always set a color filter with // blending mode SRC_ATOP. Preserve that default behavior. - mDrawableTintMode = PorterDuff.Mode.SRC_ATOP; - mHasDrawableTintMode = true; + mDrawableBlendMode = BlendMode.SRC_ATOP; + mHasDrawableBlendMode = true; } if (a.hasValue(R.styleable.ImageView_tintMode)) { - mDrawableTintMode = Drawable.parseTintMode(a.getInt( - R.styleable.ImageView_tintMode, -1), mDrawableTintMode); - mHasDrawableTintMode = true; + mDrawableBlendMode = Drawable.parseBlendMode(a.getInt( + R.styleable.ImageView_tintMode, -1), mDrawableBlendMode); + mHasDrawableBlendMode = true; } applyImageTint(); @@ -674,8 +675,23 @@ public class ImageView extends View { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setImageTintMode(@Nullable PorterDuff.Mode tintMode) { - mDrawableTintMode = tintMode; - mHasDrawableTintMode = true; + setImageTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setImageTintList(ColorStateList)}} to the image drawable. The default + * mode is {@link BlendMode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#ImageView_tintMode + * @see #getImageTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setImageTintBlendMode(@Nullable BlendMode blendMode) { + mDrawableBlendMode = blendMode; + mHasDrawableBlendMode = true; applyImageTint(); } @@ -689,19 +705,32 @@ public class ImageView extends View { @Nullable @InspectableProperty(name = "tintMode") public PorterDuff.Mode getImageTintMode() { - return mDrawableTintMode; + return mDrawableBlendMode != null + ? BlendMode.blendModeToPorterDuffMode(mDrawableBlendMode) : null; + } + + /** + * Gets the blending mode used to apply the tint to the image Drawable + * @return the blending mode used to apply the tint to the image Drawable + * @attr ref android.R.styleable#ImageView_tintMode + * @see #setImageTintBlendMode(BlendMode) + */ + @Nullable + @InspectableProperty(name = "blendMode", attributeId = android.R.styleable.ImageView_tintMode) + public BlendMode getImageTintBlendMode() { + return mDrawableBlendMode; } private void applyImageTint() { - if (mDrawable != null && (mHasDrawableTint || mHasDrawableTintMode)) { + if (mDrawable != null && (mHasDrawableTint || mHasDrawableBlendMode)) { mDrawable = mDrawable.mutate(); if (mHasDrawableTint) { mDrawable.setTintList(mDrawableTintList); } - if (mHasDrawableTintMode) { - mDrawable.setTintMode(mDrawableTintMode); + if (mHasDrawableBlendMode) { + mDrawable.setTintBlendMode(mDrawableBlendMode); } // The drawable (or one of its children) may not have been diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java index 0b433b1f9dca1..2e95743456926 100644 --- a/core/java/android/widget/ProgressBar.java +++ b/core/java/android/widget/ProgressBar.java @@ -25,6 +25,7 @@ import android.annotation.UnsupportedAppUsage; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.TypedArray; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.PorterDuff; import android.graphics.Rect; @@ -334,7 +335,7 @@ public class ProgressBar extends View { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mProgressTintMode = Drawable.parseTintMode(a.getInt( + mProgressTintInfo.mProgressBlendMode = Drawable.parseBlendMode(a.getInt( R.styleable.ProgressBar_progressTintMode, -1), null); mProgressTintInfo.mHasProgressTintMode = true; } @@ -352,7 +353,7 @@ public class ProgressBar extends View { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mProgressBackgroundTintMode = Drawable.parseTintMode(a.getInt( + mProgressTintInfo.mProgressBackgroundBlendMode = Drawable.parseBlendMode(a.getInt( R.styleable.ProgressBar_progressBackgroundTintMode, -1), null); mProgressTintInfo.mHasProgressBackgroundTintMode = true; } @@ -370,7 +371,7 @@ public class ProgressBar extends View { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mSecondaryProgressTintMode = Drawable.parseTintMode( + mProgressTintInfo.mSecondaryProgressBlendMode = Drawable.parseBlendMode( a.getInt(R.styleable.ProgressBar_secondaryProgressTintMode, -1), null); mProgressTintInfo.mHasSecondaryProgressTintMode = true; } @@ -388,7 +389,7 @@ public class ProgressBar extends View { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mIndeterminateTintMode = Drawable.parseTintMode(a.getInt( + mProgressTintInfo.mIndeterminateBlendMode = Drawable.parseBlendMode(a.getInt( R.styleable.ProgressBar_indeterminateTintMode, -1), null); mProgressTintInfo.mHasIndeterminateTintMode = true; } @@ -796,12 +797,29 @@ public class ProgressBar extends View { * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode * @see #setIndeterminateTintList(ColorStateList) * @see Drawable#setTintMode(PorterDuff.Mode) + * */ public void setIndeterminateTintMode(@Nullable PorterDuff.Mode tintMode) { + setIndeterminateTintBlendMode(tintMode != null + ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setIndeterminateTintList(ColorStateList)} to the indeterminate + * drawable. The default mode is {@link PorterDuff.Mode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode + * @see #setIndeterminateTintList(ColorStateList) + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setIndeterminateTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mIndeterminateTintMode = tintMode; + mProgressTintInfo.mIndeterminateBlendMode = blendMode; mProgressTintInfo.mHasIndeterminateTintMode = true; applyIndeterminateTint(); @@ -819,7 +837,23 @@ public class ProgressBar extends View { @InspectableProperty @Nullable public PorterDuff.Mode getIndeterminateTintMode() { - return mProgressTintInfo != null ? mProgressTintInfo.mIndeterminateTintMode : null; + BlendMode mode = getIndeterminateTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the indeterminate + * drawable, if specified. + * + * @return the blending mode used to apply the tint to the indeterminate + * drawable + * @attr ref android.R.styleable#ProgressBar_indeterminateTintMode + * @see #setIndeterminateTintBlendMode(BlendMode) + */ + @InspectableProperty(attributeId = R.styleable.ProgressBar_indeterminateTintMode) + @Nullable + public BlendMode getIndeterminateTintBlendMode() { + return mProgressTintInfo != null ? mProgressTintInfo.mIndeterminateBlendMode : null; } private void applyIndeterminateTint() { @@ -833,7 +867,7 @@ public class ProgressBar extends View { } if (tintInfo.mHasIndeterminateTintMode) { - mIndeterminateDrawable.setTintMode(tintInfo.mIndeterminateTintMode); + mIndeterminateDrawable.setTintBlendMode(tintInfo.mIndeterminateBlendMode); } // The drawable (or one of its children) may not have been @@ -956,7 +990,7 @@ public class ProgressBar extends View { target.setTintList(mProgressTintInfo.mProgressTintList); } if (mProgressTintInfo.mHasProgressTintMode) { - target.setTintMode(mProgressTintInfo.mProgressTintMode); + target.setTintBlendMode(mProgressTintInfo.mProgressBlendMode); } // The drawable (or one of its children) may not have been @@ -981,7 +1015,7 @@ public class ProgressBar extends View { target.setTintList(mProgressTintInfo.mProgressBackgroundTintList); } if (mProgressTintInfo.mHasProgressBackgroundTintMode) { - target.setTintMode(mProgressTintInfo.mProgressBackgroundTintMode); + target.setTintBlendMode(mProgressTintInfo.mProgressBackgroundBlendMode); } // The drawable (or one of its children) may not have been @@ -1006,7 +1040,7 @@ public class ProgressBar extends View { target.setTintList(mProgressTintInfo.mSecondaryProgressTintList); } if (mProgressTintInfo.mHasSecondaryProgressTintMode) { - target.setTintMode(mProgressTintInfo.mSecondaryProgressTintMode); + target.setTintBlendMode(mProgressTintInfo.mSecondaryProgressBlendMode); } // The drawable (or one of its children) may not have been @@ -1076,10 +1110,25 @@ public class ProgressBar extends View { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setProgressTintMode(@Nullable PorterDuff.Mode tintMode) { + setProgressTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setProgressTintList(ColorStateList)}} to the progress + * indicator. The default mode is {@link PorterDuff.Mode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#ProgressBar_progressTintMode + * @see #getProgressTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setProgressTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mProgressTintMode = tintMode; + mProgressTintInfo.mProgressBlendMode = blendMode; mProgressTintInfo.mHasProgressTintMode = true; if (mProgressDrawable != null) { @@ -1099,7 +1148,23 @@ public class ProgressBar extends View { @InspectableProperty @Nullable public PorterDuff.Mode getProgressTintMode() { - return mProgressTintInfo != null ? mProgressTintInfo.mProgressTintMode : null; + BlendMode mode = getProgressTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the progress + * drawable, if specified. + * + * @return the blending mode used to apply the tint to the progress + * drawable + * @attr ref android.R.styleable#ProgressBar_progressTintMode + * @see #setProgressTintBlendMode(BlendMode) + */ + @InspectableProperty(attributeId = android.R.styleable.ProgressBar_progressTintMode) + @Nullable + public BlendMode getProgressTintBlendMode() { + return mProgressTintInfo != null ? mProgressTintInfo.mProgressBlendMode : null; } /** @@ -1160,10 +1225,26 @@ public class ProgressBar extends View { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setProgressBackgroundTintMode(@Nullable PorterDuff.Mode tintMode) { + setProgressBackgroundTintBlendMode(tintMode != null + ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setProgressBackgroundTintList(ColorStateList)}} to the progress + * background. The default mode is {@link BlendMode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#ProgressBar_progressBackgroundTintMode + * @see #setProgressBackgroundTintList(ColorStateList) + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setProgressBackgroundTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mProgressBackgroundTintMode = tintMode; + mProgressTintInfo.mProgressBackgroundBlendMode = blendMode; mProgressTintInfo.mHasProgressBackgroundTintMode = true; if (mProgressDrawable != null) { @@ -1180,7 +1261,20 @@ public class ProgressBar extends View { @InspectableProperty @Nullable public PorterDuff.Mode getProgressBackgroundTintMode() { - return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundTintMode : null; + BlendMode mode = getProgressBackgroundTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * @return the blending mode used to apply the tint to the progress + * background + * @attr ref android.R.styleable#ProgressBar_progressBackgroundTintMode + * @see #setProgressBackgroundTintBlendMode(BlendMode) + */ + @InspectableProperty(attributeId = R.styleable.ProgressBar_progressBackgroundTintMode) + @Nullable + public BlendMode getProgressBackgroundTintBlendMode() { + return mProgressTintInfo != null ? mProgressTintInfo.mProgressBackgroundBlendMode : null; } /** @@ -1242,10 +1336,27 @@ public class ProgressBar extends View { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setSecondaryProgressTintMode(@Nullable PorterDuff.Mode tintMode) { + setSecondaryProgressTintBlendMode(tintMode != null + ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setSecondaryProgressTintList(ColorStateList)}} to the secondary + * progress indicator. The default mode is + * {@link PorterDuff.Mode#SRC_ATOP}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode + * @see #setSecondaryProgressTintList(ColorStateList) + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setSecondaryProgressTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); } - mProgressTintInfo.mSecondaryProgressTintMode = tintMode; + mProgressTintInfo.mSecondaryProgressBlendMode = blendMode; mProgressTintInfo.mHasSecondaryProgressTintMode = true; if (mProgressDrawable != null) { @@ -1265,7 +1376,23 @@ public class ProgressBar extends View { @InspectableProperty @Nullable public PorterDuff.Mode getSecondaryProgressTintMode() { - return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressTintMode : null; + BlendMode mode = getSecondaryProgressTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the secondary + * progress drawable, if specified. + * + * @return the blending mode used to apply the tint to the secondary + * progress drawable + * @attr ref android.R.styleable#ProgressBar_secondaryProgressTintMode + * @see #setSecondaryProgressTintBlendMode(BlendMode) + */ + @InspectableProperty(attributeId = android.R.styleable.ProgressBar_secondaryProgressTintMode) + @Nullable + public BlendMode getSecondaryProgressTintBlendMode() { + return mProgressTintInfo != null ? mProgressTintInfo.mSecondaryProgressBlendMode : null; } /** @@ -2208,22 +2335,22 @@ public class ProgressBar extends View { private static class ProgressTintInfo { ColorStateList mIndeterminateTintList; - PorterDuff.Mode mIndeterminateTintMode; + BlendMode mIndeterminateBlendMode; boolean mHasIndeterminateTint; boolean mHasIndeterminateTintMode; ColorStateList mProgressTintList; - PorterDuff.Mode mProgressTintMode; + BlendMode mProgressBlendMode; boolean mHasProgressTint; boolean mHasProgressTintMode; ColorStateList mProgressBackgroundTintList; - PorterDuff.Mode mProgressBackgroundTintMode; + BlendMode mProgressBackgroundBlendMode; boolean mHasProgressBackgroundTint; boolean mHasProgressBackgroundTintMode; ColorStateList mSecondaryProgressTintList; - PorterDuff.Mode mSecondaryProgressTintMode; + BlendMode mSecondaryProgressBlendMode; boolean mHasSecondaryProgressTint; boolean mHasSecondaryProgressTintMode; } diff --git a/core/java/android/widget/Switch.java b/core/java/android/widget/Switch.java index ea9cd421d438f..d57b3bc7ad3b4 100644 --- a/core/java/android/widget/Switch.java +++ b/core/java/android/widget/Switch.java @@ -26,6 +26,7 @@ import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Resources; import android.content.res.TypedArray; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.Insets; import android.graphics.Paint; @@ -98,14 +99,14 @@ public class Switch extends CompoundButton { @UnsupportedAppUsage private Drawable mThumbDrawable; private ColorStateList mThumbTintList = null; - private PorterDuff.Mode mThumbTintMode = null; + private BlendMode mThumbBlendMode = null; private boolean mHasThumbTint = false; private boolean mHasThumbTintMode = false; @UnsupportedAppUsage private Drawable mTrackDrawable; private ColorStateList mTrackTintList = null; - private PorterDuff.Mode mTrackTintMode = null; + private BlendMode mTrackBlendMode = null; private boolean mHasTrackTint = false; private boolean mHasTrackTintMode = false; @@ -268,10 +269,11 @@ public class Switch extends CompoundButton { mThumbTintList = thumbTintList; mHasThumbTint = true; } - PorterDuff.Mode thumbTintMode = Drawable.parseTintMode( - a.getInt(com.android.internal.R.styleable.Switch_thumbTintMode, -1), null); - if (mThumbTintMode != thumbTintMode) { - mThumbTintMode = thumbTintMode; + BlendMode thumbTintMode = Drawable.parseBlendMode( + a.getInt(com.android.internal.R.styleable.Switch_thumbTintMode, -1), + null); + if (mThumbBlendMode != thumbTintMode) { + mThumbBlendMode = thumbTintMode; mHasThumbTintMode = true; } if (mHasThumbTint || mHasThumbTintMode) { @@ -284,10 +286,11 @@ public class Switch extends CompoundButton { mTrackTintList = trackTintList; mHasTrackTint = true; } - PorterDuff.Mode trackTintMode = Drawable.parseTintMode( - a.getInt(com.android.internal.R.styleable.Switch_trackTintMode, -1), null); - if (mTrackTintMode != trackTintMode) { - mTrackTintMode = trackTintMode; + BlendMode trackTintMode = Drawable.parseBlendMode( + a.getInt(com.android.internal.R.styleable.Switch_trackTintMode, -1), + null); + if (mTrackBlendMode != trackTintMode) { + mTrackBlendMode = trackTintMode; mHasTrackTintMode = true; } if (mHasTrackTint || mHasTrackTintMode) { @@ -587,7 +590,22 @@ public class Switch extends CompoundButton { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setTrackTintMode(@Nullable PorterDuff.Mode tintMode) { - mTrackTintMode = tintMode; + setTrackTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setTrackTintList(ColorStateList)}} to the track drawable. + * The default mode is {@link BlendMode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#Switch_trackTintMode + * @see #getTrackTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setTrackTintBlendMode(@Nullable BlendMode blendMode) { + mTrackBlendMode = blendMode; mHasTrackTintMode = true; applyTrackTint(); @@ -602,7 +620,20 @@ public class Switch extends CompoundButton { @InspectableProperty @Nullable public PorterDuff.Mode getTrackTintMode() { - return mTrackTintMode; + BlendMode mode = getTrackTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * @return the blending mode used to apply the tint to the track + * drawable + * @attr ref android.R.styleable#Switch_trackTintMode + * @see #setTrackTintBlendMode(BlendMode) + */ + @InspectableProperty(attributeId = com.android.internal.R.styleable.Switch_trackTintMode) + @Nullable + public BlendMode getTrackTintBlendMode() { + return mTrackBlendMode; } private void applyTrackTint() { @@ -614,7 +645,7 @@ public class Switch extends CompoundButton { } if (mHasTrackTintMode) { - mTrackDrawable.setTintMode(mTrackTintMode); + mTrackDrawable.setTintBlendMode(mTrackBlendMode); } // The drawable (or one of its children) may not have been @@ -713,7 +744,22 @@ public class Switch extends CompoundButton { * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setThumbTintMode(@Nullable PorterDuff.Mode tintMode) { - mThumbTintMode = tintMode; + setThumbTintBlendMode(tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setThumbTintList(ColorStateList)}} to the thumb drawable. + * The default mode is {@link PorterDuff.Mode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#Switch_thumbTintMode + * @see #getThumbTintMode() + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setThumbTintBlendMode(@Nullable BlendMode blendMode) { + mThumbBlendMode = blendMode; mHasThumbTintMode = true; applyThumbTint(); @@ -728,7 +774,20 @@ public class Switch extends CompoundButton { @InspectableProperty @Nullable public PorterDuff.Mode getThumbTintMode() { - return mThumbTintMode; + BlendMode mode = getThumbTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * @return the blending mode used to apply the tint to the thumb + * drawable + * @attr ref android.R.styleable#Switch_thumbTintMode + * @see #setThumbTintBlendMode(BlendMode) + */ + @InspectableProperty(attributeId = com.android.internal.R.styleable.Switch_thumbTintMode) + @Nullable + public BlendMode getThumbTintBlendMode() { + return mThumbBlendMode; } private void applyThumbTint() { @@ -740,7 +799,7 @@ public class Switch extends CompoundButton { } if (mHasThumbTintMode) { - mThumbDrawable.setTintMode(mThumbTintMode); + mThumbDrawable.setTintBlendMode(mThumbBlendMode); } // The drawable (or one of its children) may not have been diff --git a/core/java/android/widget/TextView.java b/core/java/android/widget/TextView.java index 618b05f8cb007..17c56c3f216a5 100644 --- a/core/java/android/widget/TextView.java +++ b/core/java/android/widget/TextView.java @@ -55,6 +55,7 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.graphics.BaseCanvas; +import android.graphics.BlendMode; import android.graphics.Canvas; import android.graphics.Insets; import android.graphics.Paint; @@ -489,7 +490,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener final Drawable[] mShowing = new Drawable[4]; ColorStateList mTintList; - PorterDuff.Mode mTintMode; + BlendMode mBlendMode; boolean mHasTint; boolean mHasTintMode; @@ -1036,7 +1037,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener Drawable drawableLeft = null, drawableTop = null, drawableRight = null, drawableBottom = null, drawableStart = null, drawableEnd = null; ColorStateList drawableTint = null; - PorterDuff.Mode drawableTintMode = null; + BlendMode drawableTintMode = null; int drawablePadding = 0; int ellipsize = ELLIPSIZE_NOT_SET; boolean singleLine = false; @@ -1139,7 +1140,8 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener break; case com.android.internal.R.styleable.TextView_drawableTintMode: - drawableTintMode = Drawable.parseTintMode(a.getInt(attr, -1), drawableTintMode); + drawableTintMode = Drawable.parseBlendMode(a.getInt(attr, -1), + drawableTintMode); break; case com.android.internal.R.styleable.TextView_drawablePadding: @@ -1543,7 +1545,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener mDrawables.mHasTint = true; } if (drawableTintMode != null) { - mDrawables.mTintMode = drawableTintMode; + mDrawables.mBlendMode = drawableTintMode; mDrawables.mHasTintMode = true; } } @@ -3299,10 +3301,26 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * @see Drawable#setTintMode(PorterDuff.Mode) */ public void setCompoundDrawableTintMode(@Nullable PorterDuff.Mode tintMode) { + setCompoundDrawableTintBlendMode(tintMode != null + ? BlendMode.fromValue(tintMode.nativeInt) : null); + } + + /** + * Specifies the blending mode used to apply the tint specified by + * {@link #setCompoundDrawableTintList(ColorStateList)} to the compound + * drawables. The default mode is {@link PorterDuff.Mode#SRC_IN}. + * + * @param blendMode the blending mode used to apply the tint, may be + * {@code null} to clear tint + * @attr ref android.R.styleable#TextView_drawableTintMode + * @see #setCompoundDrawableTintList(ColorStateList) + * @see Drawable#setTintBlendMode(BlendMode) + */ + public void setCompoundDrawableTintBlendMode(@Nullable BlendMode blendMode) { if (mDrawables == null) { mDrawables = new Drawables(getContext()); } - mDrawables.mTintMode = tintMode; + mDrawables.mBlendMode = blendMode; mDrawables.mHasTintMode = true; applyCompoundDrawableTint(); @@ -3316,10 +3334,27 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener * drawables * @attr ref android.R.styleable#TextView_drawableTintMode * @see #setCompoundDrawableTintMode(PorterDuff.Mode) + * */ @InspectableProperty(name = "drawableTintMode") public PorterDuff.Mode getCompoundDrawableTintMode() { - return mDrawables != null ? mDrawables.mTintMode : null; + BlendMode mode = getCompoundDrawableTintBlendMode(); + return mode != null ? BlendMode.blendModeToPorterDuffMode(mode) : null; + } + + /** + * Returns the blending mode used to apply the tint to the compound + * drawables, if specified. + * + * @return the blending mode used to apply the tint to the compound + * drawables + * @attr ref android.R.styleable#TextView_drawableTintMode + * @see #setCompoundDrawableTintBlendMode(BlendMode) + */ + @InspectableProperty(name = "drawableBlendMode", + attributeId = com.android.internal.R.styleable.TextView_drawableTintMode) + public @Nullable BlendMode getCompoundDrawableTintBlendMode() { + return mDrawables != null ? mDrawables.mBlendMode : null; } private void applyCompoundDrawableTint() { @@ -3329,7 +3364,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener if (mDrawables.mHasTint || mDrawables.mHasTintMode) { final ColorStateList tintList = mDrawables.mTintList; - final PorterDuff.Mode tintMode = mDrawables.mTintMode; + final BlendMode blendMode = mDrawables.mBlendMode; final boolean hasTint = mDrawables.mHasTint; final boolean hasTintMode = mDrawables.mHasTintMode; final int[] state = getDrawableState(); @@ -3353,7 +3388,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener } if (hasTintMode) { - dr.setTintMode(tintMode); + dr.setTintBlendMode(blendMode); } // The drawable (or one of its children) may not have been diff --git a/graphics/java/android/graphics/BaseCanvas.java b/graphics/java/android/graphics/BaseCanvas.java index c9431e3178f00..6e7f286d19a7b 100644 --- a/graphics/java/android/graphics/BaseCanvas.java +++ b/graphics/java/android/graphics/BaseCanvas.java @@ -243,10 +243,6 @@ public abstract class BaseCanvas { nDrawColor(mNativeCanvasWrapper, color, BlendMode.SRC_OVER.getXfermode().porterDuffMode); } - /** - * @deprecated use {@link Canvas#drawColor(int, BlendMode)} - */ - @Deprecated public void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) { nDrawColor(mNativeCanvasWrapper, color, mode.nativeInt); } diff --git a/graphics/java/android/graphics/BaseRecordingCanvas.java b/graphics/java/android/graphics/BaseRecordingCanvas.java index 028b784d24c25..2f5214cb1df53 100644 --- a/graphics/java/android/graphics/BaseRecordingCanvas.java +++ b/graphics/java/android/graphics/BaseRecordingCanvas.java @@ -203,10 +203,6 @@ public class BaseRecordingCanvas extends Canvas { nDrawColor(mNativeCanvasWrapper, color, BlendMode.SRC_OVER.getXfermode().porterDuffMode); } - /** - * @deprecated use {@link #drawColor(int, BlendMode)} instead - */ - @Deprecated @Override public final void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) { nDrawColor(mNativeCanvasWrapper, color, mode.nativeInt); diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java index 6f00fc9078497..d4d5ae7bdddbe 100644 --- a/graphics/java/android/graphics/Canvas.java +++ b/graphics/java/android/graphics/Canvas.java @@ -1700,10 +1700,7 @@ public class Canvas extends BaseCanvas { * * @param color the color to draw onto the canvas * @param mode the porter-duff mode to apply to the color - * - * @deprecated use {@link #drawColor(int, BlendMode)} instead */ - @Deprecated public void drawColor(@ColorInt int color, @NonNull PorterDuff.Mode mode) { super.drawColor(color, mode); } diff --git a/graphics/java/android/graphics/ComposeShader.java b/graphics/java/android/graphics/ComposeShader.java index 93ddb10d24bc3..64ee6bf1f30ce 100644 --- a/graphics/java/android/graphics/ComposeShader.java +++ b/graphics/java/android/graphics/ComposeShader.java @@ -39,9 +39,7 @@ public class ComposeShader extends Shader { * @param shaderB The colors from this shader are seen as the "src" by the mode * @param mode The mode that combines the colors from the two shaders. If mode * is null, then SRC_OVER is assumed. - * - * @deprecated use {@link #ComposeShader(Shader, Shader, BlendMode)} instead - */ + */ @Deprecated public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB, @NonNull Xfermode mode) { this(shaderA, shaderB, mode.porterDuffMode); @@ -56,9 +54,7 @@ public class ComposeShader extends Shader { * @param shaderB The colors from this shader are seen as the "src" by the mode * @param mode The PorterDuff mode that combines the colors from the two shaders. * - * @deprecated use {@link #ComposeShader(Shader, Shader, BlendMode)} instead */ - @Deprecated public ComposeShader(@NonNull Shader shaderA, @NonNull Shader shaderB, @NonNull PorterDuff.Mode mode) { this(shaderA, shaderB, mode.nativeInt); diff --git a/graphics/java/android/graphics/Paint.java b/graphics/java/android/graphics/Paint.java index db5f06524c187..b7316ab036188 100644 --- a/graphics/java/android/graphics/Paint.java +++ b/graphics/java/android/graphics/Paint.java @@ -1274,10 +1274,7 @@ public class Paint { * Get the paint's transfer mode object. * * @return the paint's transfer mode (or null) - * - * @deprecated use {@link #getBlendMode()} instead */ - @Deprecated public Xfermode getXfermode() { return mXfermode; } @@ -1308,11 +1305,7 @@ public class Paint { * * @param xfermode May be null. The xfermode to be installed in the paint * @return xfermode - * - * @deprecated Use {@link #setBlendMode} to apply a Xfermode directly - * through usage of {@link BlendMode} */ - @Deprecated public Xfermode setXfermode(Xfermode xfermode) { return installXfermode(xfermode); } diff --git a/graphics/java/android/graphics/PorterDuff.java b/graphics/java/android/graphics/PorterDuff.java index 459291b7565e6..bc1f66fdd5c06 100644 --- a/graphics/java/android/graphics/PorterDuff.java +++ b/graphics/java/android/graphics/PorterDuff.java @@ -24,9 +24,8 @@ import android.annotation.UnsupportedAppUsage; * of {@link Paint}'s {@link Paint#setXfermode(Xfermode) transfer mode}. * All the available modes can be found in the {@link Mode} enum.

* - * @deprecated Use {@link BlendMode} with {@link Paint#setBlendMode(BlendMode)} instead + * Consider using {@link BlendMode} instead as it provides a wider variety of tinting options */ -@Deprecated public class PorterDuff { /** * {@usesMathJax} diff --git a/graphics/java/android/graphics/PorterDuffColorFilter.java b/graphics/java/android/graphics/PorterDuffColorFilter.java index c2a8eb7dbab1c..cc2d3a8969fc3 100644 --- a/graphics/java/android/graphics/PorterDuffColorFilter.java +++ b/graphics/java/android/graphics/PorterDuffColorFilter.java @@ -23,11 +23,7 @@ import android.annotation.UnsupportedAppUsage; /** * A color filter that can be used to tint the source pixels using a single * color and a specific {@link PorterDuff Porter-Duff composite mode}. - * - * @deprecated Consider using {@link BlendModeColorFilter} instead as it supports a wider - * set of blend modes than those defined in {@link PorterDuff.Mode} */ -@Deprecated public class PorterDuffColorFilter extends ColorFilter { @ColorInt private int mColor; diff --git a/graphics/java/android/graphics/PorterDuffXfermode.java b/graphics/java/android/graphics/PorterDuffXfermode.java index 5b933c493162f..ff9ff8b0069da 100644 --- a/graphics/java/android/graphics/PorterDuffXfermode.java +++ b/graphics/java/android/graphics/PorterDuffXfermode.java @@ -22,10 +22,6 @@ package android.graphics; * documentation of the {@link PorterDuff.Mode} enum for more * information on the available alpha compositing and blending modes.

* - * @deprecated Consider using {@link BlendMode} instead as it supports a wider - * set of blend modes than those defined in {@link PorterDuff.Mode} - * - * @see Paint#setBlendMode(BlendMode) */ public class PorterDuffXfermode extends Xfermode { /** diff --git a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java index 7def322c1953a..fab96a1e9fbde 100644 --- a/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java +++ b/graphics/java/android/graphics/drawable/AdaptiveIconDrawable.java @@ -701,13 +701,13 @@ public class AdaptiveIconDrawable extends Drawable implements Drawable.Callback } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { final ChildDrawable[] array = mLayerState.mChildren; final int N = mLayerState.N_CHILDREN; for (int i = 0; i < N; i++) { final Drawable dr = array[i].mDrawable; if (dr != null) { - dr.setTintMode(blendMode); + dr.setTintBlendMode(blendMode); } } } diff --git a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java index f45bf9b783e8d..66947da9166f6 100644 --- a/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedVectorDrawable.java @@ -477,8 +477,8 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable2 { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { - mAnimatedVectorState.mVectorDrawable.setTintMode(blendMode); + public void setTintBlendMode(@NonNull BlendMode blendMode) { + mAnimatedVectorState.mVectorDrawable.setTintBlendMode(blendMode); } @Override diff --git a/graphics/java/android/graphics/drawable/BitmapDrawable.java b/graphics/java/android/graphics/drawable/BitmapDrawable.java index 6b30158a183ad..e4aa774fd4344 100644 --- a/graphics/java/android/graphics/drawable/BitmapDrawable.java +++ b/graphics/java/android/graphics/drawable/BitmapDrawable.java @@ -685,7 +685,7 @@ public class BitmapDrawable extends Drawable { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { final BitmapState state = mBitmapState; if (state.mBlendMode != blendMode) { state.mBlendMode = blendMode; diff --git a/graphics/java/android/graphics/drawable/ColorDrawable.java b/graphics/java/android/graphics/drawable/ColorDrawable.java index efa806afce70d..f5fa8c546bed3 100644 --- a/graphics/java/android/graphics/drawable/ColorDrawable.java +++ b/graphics/java/android/graphics/drawable/ColorDrawable.java @@ -215,7 +215,7 @@ public class ColorDrawable extends Drawable { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { mColorState.mBlendMode = blendMode; mBlendModeColorFilter = updateBlendModeFilter(mBlendModeColorFilter, mColorState.mTint, blendMode); diff --git a/graphics/java/android/graphics/drawable/ColorStateListDrawable.java b/graphics/java/android/graphics/drawable/ColorStateListDrawable.java index b94b114683717..35021a66f572a 100644 --- a/graphics/java/android/graphics/drawable/ColorStateListDrawable.java +++ b/graphics/java/android/graphics/drawable/ColorStateListDrawable.java @@ -114,9 +114,9 @@ public class ColorStateListDrawable extends Drawable implements Drawable.Callbac } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { mState.mBlendMode = blendMode; - mColorDrawable.setTintMode(blendMode); + mColorDrawable.setTintBlendMode(blendMode); onStateChange(getState()); } @@ -293,7 +293,7 @@ public class ColorStateListDrawable extends Drawable implements Drawable.Callbac } if (mState.mBlendMode != DEFAULT_BLEND_MODE) { - mColorDrawable.setTintMode(mState.mBlendMode); + mColorDrawable.setTintBlendMode(mState.mBlendMode); } } } diff --git a/graphics/java/android/graphics/drawable/Drawable.java b/graphics/java/android/graphics/drawable/Drawable.java index adc04fb03e2a1..08409869c6260 100644 --- a/graphics/java/android/graphics/drawable/Drawable.java +++ b/graphics/java/android/graphics/drawable/Drawable.java @@ -213,17 +213,17 @@ public abstract class Drawable { protected int mSrcDensityOverride = 0; /** - * Flag used to break the recursive loop between setTintMode(PorterDuff.Mode) and - * setTintMode(BlendMode) as each default implementation invokes the other in order to + * Flag used to break the recursive loop between setTintBlendMode(PorterDuff.Mode) and + * setTintBlendMode(BlendMode) as each default implementation invokes the other in order to * support new use cases that utilize the new blending modes as well as support the legacy - * use cases. This flag tracks that {@link #setTintMode(BlendMode)} is only invoked once + * use cases. This flag tracks that {@link #setTintBlendMode(BlendMode)} is only invoked once * per invocation. */ private boolean mSetBlendModeInvoked = false; /** - * Flag used to break the recursive loop between setTintMode(PorterDuff.Mode) and - * setTintMode(BlendMode) as each default implementation invokes the other in order to + * Flag used to break the recursive loop between setTintBlendMode(PorterDuff.Mode) and + * setTintBlendMode(BlendMode) as each default implementation invokes the other in order to * support new use cases that utilize the new blending modes as well as support the legacy * use cases. This flag tracks that {@link #setTintMode(Mode)} is only invoked once * per invocation; @@ -651,7 +651,7 @@ public abstract class Drawable { * @param tintColor Color to use for tinting this drawable * @see #setTintList(ColorStateList) * @see #setTintMode(PorterDuff.Mode) - * @see #setTintMode(BlendMode) + * @see #setTintBlendMode(BlendMode) */ public void setTint(@ColorInt int tintColor) { setTintList(ColorStateList.valueOf(tintColor)); @@ -673,7 +673,7 @@ public abstract class Drawable { * {@code null} to clear the tint * @see #setTint(int) * @see #setTintMode(PorterDuff.Mode) - * @see #setTintMode(BlendMode) + * @see #setTintBlendMode(BlendMode) */ public void setTintList(@Nullable ColorStateList tint) {} @@ -693,15 +693,12 @@ public abstract class Drawable { * of {@link PorterDuff.Mode#SRC_IN} * @see #setTint(int) * @see #setTintList(ColorStateList) - * - * @deprecated use {@link #setTintMode(BlendMode)} instead */ - @Deprecated public void setTintMode(@Nullable PorterDuff.Mode tintMode) { if (!mSetTintModeInvoked) { mSetTintModeInvoked = true; BlendMode mode = tintMode != null ? BlendMode.fromValue(tintMode.nativeInt) : null; - setTintMode(mode != null ? mode : Drawable.DEFAULT_BLEND_MODE); + setTintBlendMode(mode != null ? mode : Drawable.DEFAULT_BLEND_MODE); mSetTintModeInvoked = false; } } @@ -721,7 +718,7 @@ public abstract class Drawable { * @see #setTint(int) * @see #setTintList(ColorStateList) */ - public void setTintMode(@Nullable BlendMode blendMode) { + public void setTintBlendMode(@Nullable BlendMode blendMode) { if (!mSetBlendModeInvoked) { mSetBlendModeInvoked = true; PorterDuff.Mode mode = BlendMode.blendModeToPorterDuffMode(blendMode); diff --git a/graphics/java/android/graphics/drawable/DrawableContainer.java b/graphics/java/android/graphics/drawable/DrawableContainer.java index 3e0881aef9edc..090d915a2f67d 100644 --- a/graphics/java/android/graphics/drawable/DrawableContainer.java +++ b/graphics/java/android/graphics/drawable/DrawableContainer.java @@ -196,14 +196,14 @@ public class DrawableContainer extends Drawable implements Drawable.Callback { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { mDrawableContainerState.mHasTintMode = true; if (mDrawableContainerState.mBlendMode != blendMode) { mDrawableContainerState.mBlendMode = blendMode; if (mCurrDrawable != null) { - mCurrDrawable.setTintMode(blendMode); + mCurrDrawable.setTintBlendMode(blendMode); } } } @@ -544,7 +544,7 @@ public class DrawableContainer extends Drawable implements Drawable.Callback { d.setTintList(mDrawableContainerState.mTintList); } if (mDrawableContainerState.mHasTintMode) { - d.setTintMode(mDrawableContainerState.mBlendMode); + d.setTintBlendMode(mDrawableContainerState.mBlendMode); } } diff --git a/graphics/java/android/graphics/drawable/DrawableWrapper.java b/graphics/java/android/graphics/drawable/DrawableWrapper.java index d81401d451ca1..64fc7042dfc7d 100644 --- a/graphics/java/android/graphics/drawable/DrawableWrapper.java +++ b/graphics/java/android/graphics/drawable/DrawableWrapper.java @@ -324,9 +324,9 @@ public abstract class DrawableWrapper extends Drawable implements Drawable.Callb } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { if (mDrawable != null) { - mDrawable.setTintMode(blendMode); + mDrawable.setTintBlendMode(blendMode); } } diff --git a/graphics/java/android/graphics/drawable/GradientDrawable.java b/graphics/java/android/graphics/drawable/GradientDrawable.java index 6948bc4fd61b9..816d1fda57d10 100644 --- a/graphics/java/android/graphics/drawable/GradientDrawable.java +++ b/graphics/java/android/graphics/drawable/GradientDrawable.java @@ -1211,7 +1211,7 @@ public class GradientDrawable extends Drawable { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { mGradientState.mBlendMode = blendMode; mBlendModeColorFilter = updateBlendModeFilter(mBlendModeColorFilter, mGradientState.mTint, blendMode); diff --git a/graphics/java/android/graphics/drawable/Icon.java b/graphics/java/android/graphics/drawable/Icon.java index 5fd18a1431e00..3658f89abae16 100644 --- a/graphics/java/android/graphics/drawable/Icon.java +++ b/graphics/java/android/graphics/drawable/Icon.java @@ -324,7 +324,7 @@ public final class Icon implements Parcelable { if (result != null && (mTintList != null || mBlendMode != DEFAULT_BLEND_MODE)) { result.mutate(); result.setTintList(mTintList); - result.setTintMode(mBlendMode); + result.setTintBlendMode(mBlendMode); } return result; } @@ -696,10 +696,7 @@ public final class Icon implements Parcelable { * * @param mode a blending mode, as in {@link Drawable#setTintMode(PorterDuff.Mode)}, may be null * @return this same object, for use in chained construction - * - * @deprecated use {@link #setTintMode(BlendMode)} instead */ - @Deprecated public @NonNull Icon setTintMode(@NonNull PorterDuff.Mode mode) { mBlendMode = BlendMode.fromValue(mode.nativeInt); return this; @@ -711,7 +708,7 @@ public final class Icon implements Parcelable { * @param mode a blending mode, as in {@link Drawable#setTintMode(PorterDuff.Mode)}, may be null * @return this same object, for use in chained construction */ - public @NonNull Icon setTintMode(@NonNull BlendMode mode) { + public @NonNull Icon setTintBlendMode(@NonNull BlendMode mode) { mBlendMode = mode; return this; } diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index e2c84927b5781..f3a1b0eb52d59 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java @@ -1397,13 +1397,13 @@ public class LayerDrawable extends Drawable implements Drawable.Callback { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { final ChildDrawable[] array = mLayerState.mChildren; final int N = mLayerState.mNumChildren; for (int i = 0; i < N; i++) { final Drawable dr = array[i].mDrawable; if (dr != null) { - dr.setTintMode(blendMode); + dr.setTintBlendMode(blendMode); } } } diff --git a/graphics/java/android/graphics/drawable/NinePatchDrawable.java b/graphics/java/android/graphics/drawable/NinePatchDrawable.java index 4972e6a82b7df..8561d95ddd889 100644 --- a/graphics/java/android/graphics/drawable/NinePatchDrawable.java +++ b/graphics/java/android/graphics/drawable/NinePatchDrawable.java @@ -349,7 +349,7 @@ public class NinePatchDrawable extends Drawable { } @Override - public void setTintMode(@Nullable BlendMode blendMode) { + public void setTintBlendMode(@Nullable BlendMode blendMode) { mNinePatchState.mBlendMode = blendMode; mBlendModeFilter = updateBlendModeFilter(mBlendModeFilter, mNinePatchState.mTint, blendMode); diff --git a/graphics/java/android/graphics/drawable/ShapeDrawable.java b/graphics/java/android/graphics/drawable/ShapeDrawable.java index b5fe7f9e432d4..9774b59f98a9b 100644 --- a/graphics/java/android/graphics/drawable/ShapeDrawable.java +++ b/graphics/java/android/graphics/drawable/ShapeDrawable.java @@ -297,7 +297,7 @@ public class ShapeDrawable extends Drawable { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { mShapeState.mBlendMode = blendMode; mBlendModeColorFilter = updateBlendModeFilter(mBlendModeColorFilter, mShapeState.mTint, blendMode); diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java index 43772ec20cf39..aa19b2a0e94c9 100644 --- a/graphics/java/android/graphics/drawable/VectorDrawable.java +++ b/graphics/java/android/graphics/drawable/VectorDrawable.java @@ -487,7 +487,7 @@ public class VectorDrawable extends Drawable { } @Override - public void setTintMode(@NonNull BlendMode blendMode) { + public void setTintBlendMode(@NonNull BlendMode blendMode) { final VectorDrawableState state = mVectorState; if (state.mBlendMode != blendMode) { state.mBlendMode = blendMode;