diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/view/View.java | 2 | ||||
| -rw-r--r-- | core/java/android/widget/ImageView.java | 1 | ||||
| -rw-r--r-- | core/java/android/widget/ProgressBar.java | 4 | ||||
| -rw-r--r-- | core/java/android/widget/RemoteViews.java | 23 |
4 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index ba78f966b218..44d4d6b24f58 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -24032,6 +24032,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @see #getBackgroundTintMode() * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setBackgroundTintBlendMode(@Nullable BlendMode blendMode) { if (mBackgroundTint == null) { mBackgroundTint = new TintInfo(); @@ -24294,6 +24295,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, * @see #getForegroundTintMode() * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setForegroundTintBlendMode(@Nullable BlendMode blendMode) { if (mForegroundInfo == null) { mForegroundInfo = new ForegroundInfo(); diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index ed20d26a8b47..0a08ccd34f02 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -695,6 +695,7 @@ public class ImageView extends View { * @see #getImageTintMode() * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setImageTintBlendMode(@Nullable BlendMode blendMode) { mDrawableBlendMode = blendMode; mHasDrawableBlendMode = true; diff --git a/core/java/android/widget/ProgressBar.java b/core/java/android/widget/ProgressBar.java index 67216f5955f7..a44808eb3120 100644 --- a/core/java/android/widget/ProgressBar.java +++ b/core/java/android/widget/ProgressBar.java @@ -823,6 +823,7 @@ public class ProgressBar extends View { * @see #setIndeterminateTintList(ColorStateList) * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setIndeterminateTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); @@ -1132,6 +1133,7 @@ public class ProgressBar extends View { * @see #getProgressTintMode() * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setProgressTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); @@ -1248,6 +1250,7 @@ public class ProgressBar extends View { * @see #setProgressBackgroundTintList(ColorStateList) * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setProgressBackgroundTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); @@ -1360,6 +1363,7 @@ public class ProgressBar extends View { * @see #setSecondaryProgressTintList(ColorStateList) * @see Drawable#setTintBlendMode(BlendMode) */ + @RemotableViewMethod public void setSecondaryProgressTintBlendMode(@Nullable BlendMode blendMode) { if (mProgressTintInfo == null) { mProgressTintInfo = new ProgressTintInfo(); diff --git a/core/java/android/widget/RemoteViews.java b/core/java/android/widget/RemoteViews.java index 4e3d99b43cf6..81572b5bbb45 100644 --- a/core/java/android/widget/RemoteViews.java +++ b/core/java/android/widget/RemoteViews.java @@ -47,6 +47,7 @@ import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Bitmap; +import android.graphics.BlendMode; import android.graphics.Outline; import android.graphics.PointF; import android.graphics.PorterDuff; @@ -1054,6 +1055,8 @@ public class RemoteViews implements Parcelable, Filter { return ColorStateList.class; case BaseReflectionAction.ICON: return Icon.class; + case BaseReflectionAction.BLEND_MODE: + return BlendMode.class; default: return null; } @@ -1400,6 +1403,7 @@ public class RemoteViews implements Parcelable, Filter { static final int INTENT = 14; static final int COLOR_STATE_LIST = 15; static final int ICON = 16; + static final int BLEND_MODE = 17; @UnsupportedAppUsage String methodName; @@ -1589,6 +1593,10 @@ public class RemoteViews implements Parcelable, Filter { break; case ICON: this.value = in.readTypedObject(Icon.CREATOR); + break; + case BLEND_MODE: + this.value = BlendMode.fromValue(in.readInt()); + break; default: break; } @@ -1632,6 +1640,9 @@ public class RemoteViews implements Parcelable, Filter { case BUNDLE: out.writeBundle((Bundle) this.value); break; + case BLEND_MODE: + out.writeInt(BlendMode.toValue((BlendMode) this.value)); + break; case URI: case BITMAP: case INTENT: @@ -4132,6 +4143,18 @@ public class RemoteViews implements Parcelable, Filter { } /** + * Call a method taking one BlendMode on a view in the layout for this RemoteViews. + * + * @param viewId The id of the view on which to call the method. + * @param methodName The name of the method to call. + * @param value The value to pass to the method. + */ + public void setBlendMode(@IdRes int viewId, @NonNull String methodName, + @Nullable BlendMode value) { + addAction(new ReflectionAction(viewId, methodName, BaseReflectionAction.BLEND_MODE, value)); + } + + /** * Call a method taking one Bundle on a view in the layout for this RemoteViews. * * @param viewId The id of the view on which to call the method. |
