diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-06-21 17:28:23 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-06-21 17:29:04 -0700 |
commit | 2814112998042ccb5bda9501a5ae474f2b2832c6 (patch) | |
tree | 6efc8840750518feee681a543a3d2da259eca904 /src/com/android/launcher3/dragndrop | |
parent | 318f567a849223284eecec761c23b41a3fd2e568 (diff) | |
download | android_packages_apps_Trebuchet-2814112998042ccb5bda9501a5ae474f2b2832c6.tar.gz android_packages_apps_Trebuchet-2814112998042ccb5bda9501a5ae474f2b2832c6.tar.bz2 android_packages_apps_Trebuchet-2814112998042ccb5bda9501a5ae474f2b2832c6.zip |
Properly desaturating the dragview if the icon is disabled
Change-Id: Ic53078750fab013ed07999c6e9a6bf5d9b4c2554
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragView.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragView.java b/src/com/android/launcher3/dragndrop/DragView.java index 0418d255d..ab2f10036 100644 --- a/src/com/android/launcher3/dragndrop/DragView.java +++ b/src/com/android/launcher3/dragndrop/DragView.java @@ -29,6 +29,7 @@ import android.content.pm.LauncherActivityInfo; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; +import android.graphics.ColorFilter; import android.graphics.ColorMatrix; import android.graphics.ColorMatrixColorFilter; import android.graphics.Matrix; @@ -245,6 +246,15 @@ public class DragView extends FrameLayout { addView(mBgImageView); addView(mFgImageView); setWillNotDraw(true); + + if (info.isDisabled()) { + FastBitmapDrawable d = new FastBitmapDrawable(null); + d.setIsDisabled(true); + ColorFilter cf = d.getColorFilter(); + mBgImageView.setColorFilter(cf); + mFgImageView.setColorFilter(cf); + mBadge.setColorFilter(cf); + } } }); } |