Properly desaturating the dragview if the icon is disabled

Change-Id: Ic53078750fab013ed07999c6e9a6bf5d9b4c2554
This commit is contained in:
Sunny Goyal
2017-06-21 17:28:23 -07:00
parent 318f567a84
commit 2814112998
2 changed files with 15 additions and 2 deletions

View File

@@ -36,8 +36,6 @@ import com.android.launcher3.graphics.IconPalette;
public class FastBitmapDrawable extends Drawable {
private static final int[] STATE_PRESSED = new int[] {android.R.attr.state_pressed};
private static final float PRESSED_BRIGHTNESS = 100f / 255f;
private static final float DISABLED_DESATURATION = 1f;
private static final float DISABLED_BRIGHTNESS = 0.5f;
@@ -184,6 +182,11 @@ public class FastBitmapDrawable extends Drawable {
return true;
}
@Override
public ColorFilter getColorFilter() {
return mPaint.getColorFilter();
}
@Override
protected boolean onStateChange(int[] state) {
boolean isPressed = false;