diff options
author | Adam Powell <adamp@google.com> | 2013-10-07 17:01:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-07 17:01:16 -0700 |
commit | 80da140cc4ce2df529bae92d379ed8598acf356c (patch) | |
tree | 35d8ced0c424ba406fd1f79c734ee7898fcc0178 /core/java/android/widget | |
parent | 386ea6e0cde317872d600e0e07dd6a16541fc28f (diff) | |
parent | 266b3026c42ed3ba0feedd9abe3e3bb6932c2f23 (diff) | |
download | frameworks_base-80da140cc4ce2df529bae92d379ed8598acf356c.zip frameworks_base-80da140cc4ce2df529bae92d379ed8598acf356c.tar.gz frameworks_base-80da140cc4ce2df529bae92d379ed8598acf356c.tar.bz2 |
am 266b3026: am 20ba658b: am 31049d76: Use SCREEN Xfermode for keyguard badges; update SeekBar
* commit '266b3026c42ed3ba0feedd9abe3e3bb6932c2f23':
Use SCREEN Xfermode for keyguard badges; update SeekBar
Diffstat (limited to 'core/java/android/widget')
-rw-r--r-- | core/java/android/widget/ImageView.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 251ecb2..cfd7e4a 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; @@ -1130,6 +1132,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 @@ -1205,6 +1219,7 @@ public class ImageView extends View { if (mDrawable != null && mColorMod) { mDrawable = mDrawable.mutate(); mDrawable.setColorFilter(mColorFilter); + mDrawable.setXfermode(mXfermode); mDrawable.setAlpha(mAlpha * mViewAlphaScale >> 8); } } |