diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-03-29 19:48:33 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-03-29 19:48:33 +0000 |
commit | 188106349ca40e59f6861be2c2db795b3e2b9e57 (patch) | |
tree | 17752c8264345c465dcc2a4da17e925ce257df64 | |
parent | c3e5d3ef1b31083453fcb6b191c742b2e2511b0f (diff) | |
parent | b6d686dcebc19e78c82b12151f4e983c39c35aee (diff) | |
download | android_packages_apps_Trebuchet-188106349ca40e59f6861be2c2db795b3e2b9e57.tar.gz android_packages_apps_Trebuchet-188106349ca40e59f6861be2c2db795b3e2b9e57.tar.bz2 android_packages_apps_Trebuchet-188106349ca40e59f6861be2c2db795b3e2b9e57.zip |
Merge "Add disabled boolean to FastBitmapDrawable constant state." into ub-launcher3-master
-rw-r--r-- | src/com/android/launcher3/FastBitmapDrawable.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/launcher3/FastBitmapDrawable.java b/src/com/android/launcher3/FastBitmapDrawable.java index 964e8b685..7ab88a008 100644 --- a/src/com/android/launcher3/FastBitmapDrawable.java +++ b/src/com/android/launcher3/FastBitmapDrawable.java @@ -103,9 +103,14 @@ public class FastBitmapDrawable extends Drawable { } protected FastBitmapDrawable(Bitmap b, int iconColor) { + this(b, iconColor, false); + } + + protected FastBitmapDrawable(Bitmap b, int iconColor, boolean isDisabled) { mBitmap = b; mIconColor = iconColor; setFilterBitmap(true); + setIsDisabled(isDisabled); } @Override @@ -249,6 +254,10 @@ public class FastBitmapDrawable extends Drawable { } } + protected boolean isDisabled() { + return mIsDisabled; + } + /** * Sets the saturation of this icon, 0 [full color] -> 1 [desaturated] */ @@ -338,21 +347,23 @@ public class FastBitmapDrawable extends Drawable { @Override public ConstantState getConstantState() { - return new MyConstantState(mBitmap, mIconColor); + return new MyConstantState(mBitmap, mIconColor, mIsDisabled); } protected static class MyConstantState extends ConstantState { protected final Bitmap mBitmap; protected final int mIconColor; + protected final boolean mIsDisabled; - public MyConstantState(Bitmap bitmap, int color) { + public MyConstantState(Bitmap bitmap, int color, boolean isDisabled) { mBitmap = bitmap; mIconColor = color; + mIsDisabled = isDisabled; } @Override public Drawable newDrawable() { - return new FastBitmapDrawable(mBitmap, mIconColor); + return new FastBitmapDrawable(mBitmap, mIconColor, mIsDisabled); } @Override |