Keep disabled FastBitmapDrawables disabled while fast scrolling.
Previously, they were animating to be colored because they were
set to have a FAST_SCROLL_UNLHIGHLIGHTED state. Now they retain
their disabled color when changing fast scroll states.
Specfically, we remove the DISABLED state and instead make it a
property of the FastBitmapDrawable.
Bug: 32642959
Change-Id: I6cb2da134a550c267eebfc756eff8c91a33f028c
diff --git a/src/com/android/launcher3/PreloadIconDrawable.java b/src/com/android/launcher3/PreloadIconDrawable.java
index 8295b45..efc0eac 100644
--- a/src/com/android/launcher3/PreloadIconDrawable.java
+++ b/src/com/android/launcher3/PreloadIconDrawable.java
@@ -177,10 +177,8 @@
// Set the paint color only when the level changes, so that the dominant color
// is only calculated when needed.
mPaint.setColor(getIndicatorColor());
- }
- if (mIcon instanceof FastBitmapDrawable) {
- ((FastBitmapDrawable) mIcon).setState(level <= 0 ?
- FastBitmapDrawable.State.DISABLED : FastBitmapDrawable.State.NORMAL);
+ } else if (mIcon instanceof FastBitmapDrawable) {
+ ((FastBitmapDrawable) mIcon).setIsDisabled(true);
}
invalidateSelf();