From 31049d76c55b18a6d9993f0d9687598740b16014 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Mon, 7 Oct 2013 12:58:42 -0700 Subject: Use SCREEN Xfermode for keyguard badges; update SeekBar Plumb through the necessary API features through Drawables and ImageView but leave it hidden for now pending future API review and plumbing through the rest of the framework Drawable implementations. Update SeekBar assets used for keyguard transport control. Set selected status directly instead of finding views by id. Bug 10531608 Bug 10784913 Change-Id: Ia38bd04ad1bc26e9e6da1dda8a374c9ba3ceccb3 --- core/java/android/widget/ImageView.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/java/android') diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 3e53b91..9e35a23 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -27,6 +27,7 @@ import android.graphics.Matrix; import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.graphics.RectF; +import android.graphics.Xfermode; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.net.Uri; @@ -73,6 +74,7 @@ public class ImageView extends View { // these are applied to the drawable private ColorFilter mColorFilter; + private Xfermode mXfermode; private int mAlpha = 255; private int mViewAlphaScale = 256; private boolean mColorMod = false; @@ -1125,6 +1127,18 @@ public class ImageView extends View { } /** + * @hide Candidate for future API inclusion + */ + public final void setXfermode(Xfermode mode) { + if (mXfermode != mode) { + mXfermode = mode; + mColorMod = true; + applyColorMod(); + invalidate(); + } + } + + /** * Returns the active color filter for this ImageView. * * @return the active color filter for this ImageView @@ -1200,6 +1214,7 @@ public class ImageView extends View { if (mDrawable != null && mColorMod) { mDrawable = mDrawable.mutate(); mDrawable.setColorFilter(mColorFilter); + mDrawable.setXfermode(mXfermode); mDrawable.setAlpha(mAlpha * mViewAlphaScale >> 8); } } -- cgit v1.1