diff options
author | Kenny Guy <kennyguy@google.com> | 2016-01-21 19:50:02 +0000 |
---|---|---|
committer | Rubin Xu <rubinxu@google.com> | 2016-01-25 11:28:06 +0000 |
commit | 44cba696386b44f9115cad13ec9ecf67a0ac9119 (patch) | |
tree | bc8b35320ed88f134708c85b107680152c199b33 /src/com/android/launcher3/BubbleTextView.java | |
parent | f076eae0cab10f035f7b187c72a680cd220acf1b (diff) | |
download | android_packages_apps_Trebuchet-44cba696386b44f9115cad13ec9ecf67a0ac9119.tar.gz android_packages_apps_Trebuchet-44cba696386b44f9115cad13ec9ecf67a0ac9119.tar.bz2 android_packages_apps_Trebuchet-44cba696386b44f9115cad13ec9ecf67a0ac9119.zip |
Grey out suspended applications.
Grey out application shortcuts and all apps entries
for packages that are suspended.
Bug: 22776761
Change-Id: I1b63da1816aca1de52b9f9bee62d1b162d0cdf4d
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index ce7e39252..8842d5cdd 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -150,7 +150,7 @@ public class BubbleTextView extends TextView Bitmap b = info.getIcon(iconCache); FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(b); - if (info.isDisabled != 0) { + if (info.isDisabled()) { iconDrawable.setState(FastBitmapDrawable.State.DISABLED); } setIcon(iconDrawable, mIconSize); @@ -166,7 +166,11 @@ public class BubbleTextView extends TextView } public void applyFromApplicationInfo(AppInfo info) { - setIcon(mLauncher.createIconDrawable(info.iconBitmap), mIconSize); + FastBitmapDrawable iconDrawable = mLauncher.createIconDrawable(info.iconBitmap); + if (info.isDisabled()) { + iconDrawable.setState(FastBitmapDrawable.State.DISABLED); + } + setIcon(iconDrawable, mIconSize); setText(info.title); if (info.contentDescription != null) { setContentDescription(info.contentDescription); @@ -250,11 +254,11 @@ public class BubbleTextView extends TextView private void updateIconState() { if (mIcon instanceof FastBitmapDrawable) { FastBitmapDrawable d = (FastBitmapDrawable) mIcon; - if (isPressed() || mStayPressed) { - d.animateState(FastBitmapDrawable.State.PRESSED); - } else if (getTag() instanceof ShortcutInfo - && ((ShortcutInfo) getTag()).isDisabled != 0) { + if (getTag() instanceof ItemInfo + && ((ItemInfo) getTag()).isDisabled()) { d.animateState(FastBitmapDrawable.State.DISABLED); + } else if (isPressed() || mStayPressed) { + d.animateState(FastBitmapDrawable.State.PRESSED); } else { d.animateState(FastBitmapDrawable.State.NORMAL); } |