diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2014-07-14 12:02:01 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2014-07-18 16:10:34 -0700 |
commit | c5c60ad3592f53549c9ffaa58e9a87b0480080e8 (patch) | |
tree | a4c01c55af65ca0262f9dfeade896fef263c7b0a /src/com/android/launcher3/BubbleTextView.java | |
parent | e8a30577f7451ed0f50ce7cd86e0d3f0c0e0d0bc (diff) | |
download | android_packages_apps_Trebuchet-c5c60ad3592f53549c9ffaa58e9a87b0480080e8.tar.gz android_packages_apps_Trebuchet-c5c60ad3592f53549c9ffaa58e9a87b0480080e8.tar.bz2 android_packages_apps_Trebuchet-c5c60ad3592f53549c9ffaa58e9a87b0480080e8.zip |
Merging Motorola's patch to disable apps when is safe mode.
issue: 16044192
Change-Id: I10069dcdf459ecc71361271e883eabb743d77822
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 3f619a812..ffa7ec37e 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -51,8 +51,6 @@ public class BubbleTextView extends TextView { private static final boolean DEBUG = false; - private int mPrevAlpha = -1; - private HolographicOutlineHelper mOutlineHelper; private final Canvas mTempCanvas = new Canvas(); private final Rect mTempRect = new Rect(); @@ -124,14 +122,22 @@ public class BubbleTextView extends TextView { } } - public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache) { + public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache, + boolean setDefaultPadding) { Bitmap b = info.getIcon(iconCache); LauncherAppState app = LauncherAppState.getInstance(); - DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); - Drawable iconDrawable = Utilities.createIconDrawable(b); + FastBitmapDrawable iconDrawable = Utilities.createIconDrawable(b); + if (info.isDisabled) { + iconDrawable.setSaturation(0); + iconDrawable.setBrightness(20); + } + setCompoundDrawables(null, iconDrawable, null, null); - setCompoundDrawablePadding(grid.iconDrawablePaddingPx); + if (setDefaultPadding) { + DeviceProfile grid = app.getDynamicGrid().getDeviceProfile(); + setCompoundDrawablePadding(grid.iconDrawablePaddingPx); + } if (info.contentDescription != null) { setContentDescription(info.contentDescription); } @@ -417,10 +423,6 @@ public class BubbleTextView extends TextView { @Override protected boolean onSetAlpha(int alpha) { - if (mPrevAlpha != alpha) { - mPrevAlpha = alpha; - super.onSetAlpha(alpha); - } return true; } |