Grey out suspended applications.

Grey out application shortcuts and all apps entries
for packages that are suspended.

Bug: 22776761
Change-Id: I1b63da1816aca1de52b9f9bee62d1b162d0cdf4d
(cherry picked from commit 44cba69638)
This commit is contained in:
Kenny Guy authored and Sunny Goyal committed 2016-04-07 19:39:58 +00:00
1 parent 04907eea71
commit 82fdb81d63
13 files changed
+199 -17

No files matched your search

+10 -6
View File
@@ -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);
}