diff options
| author | Alan Viverette <alanv@google.com> | 2014-09-15 16:25:09 -0700 |
|---|---|---|
| committer | Alan Viverette <alanv@google.com> | 2014-09-15 16:25:09 -0700 |
| commit | 38f93bcb2155d9af821261f4eff5c2d7ba9234e5 (patch) | |
| tree | 57d35ff82f2ebcad2b5a22446de659efa57dab24 /core/java/android/widget/ImageView.java | |
| parent | 5ff1d4f8482b48b71f09c268bf4830f78bfe7b77 (diff) | |
Always apply ImageView's tint attribute using SRC_ATOP by default
Preserves pre-L behavior and avoids requiring developers to manually
set the tintMode to SRC_ATOP when targeting SDK 21+.
BUG: 17507827
Change-Id: I43f86cbcb9662172254f46700441ca85a54428f6
Diffstat (limited to 'core/java/android/widget/ImageView.java')
| -rw-r--r-- | core/java/android/widget/ImageView.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/java/android/widget/ImageView.java b/core/java/android/widget/ImageView.java index 6eb94711d41c..f90a9fe24e92 100644 --- a/core/java/android/widget/ImageView.java +++ b/core/java/android/widget/ImageView.java @@ -173,11 +173,10 @@ public class ImageView extends View { mDrawableTintList = a.getColorStateList(R.styleable.ImageView_tint); mHasDrawableTint = true; - // Prior to L, the tint mode was always SRC_ATOP. - if (mContext.getApplicationInfo().targetSdkVersion <= Build.VERSION_CODES.L) { - mDrawableTintMode = PorterDuff.Mode.SRC_ATOP; - mHasDrawableTintMode = true; - } + // 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; } if (a.hasValue(R.styleable.ImageView_tintMode)) { |
