summaryrefslogtreecommitdiffstats
path: root/core/java/android
diff options
context:
space:
mode:
authorAdam Powell <adamp@google.com>2013-10-07 12:58:42 -0700
committerAdam Powell <adamp@google.com>2013-10-07 16:14:17 -0700
commit31049d76c55b18a6d9993f0d9687598740b16014 (patch)
tree79bf629079bfc443f3c00597912e415d92636200 /core/java/android
parentdbc31105bda3591d64e4d3e2abb3b3eaf857222e (diff)
downloadframeworks_base-31049d76c55b18a6d9993f0d9687598740b16014.zip
frameworks_base-31049d76c55b18a6d9993f0d9687598740b16014.tar.gz
frameworks_base-31049d76c55b18a6d9993f0d9687598740b16014.tar.bz2
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
Diffstat (limited to 'core/java/android')
-rw-r--r--core/java/android/widget/ImageView.java15
1 files changed, 15 insertions, 0 deletions
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);
}
}