diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-11-09 10:43:58 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-12-13 10:31:12 -0800 |
commit | 1cd01b023acc123b771765b7297d8aaedac224e0 (patch) | |
tree | 9f275f4cbf290c7fb7e67a913bba14079abcd982 /src/com/android/launcher3/BubbleTextView.java | |
parent | 824c540f1911101321ebe7f05cb0885a4922e363 (diff) | |
download | android_packages_apps_Trebuchet-1cd01b023acc123b771765b7297d8aaedac224e0.tar.gz android_packages_apps_Trebuchet-1cd01b023acc123b771765b7297d8aaedac224e0.tar.bz2 android_packages_apps_Trebuchet-1cd01b023acc123b771765b7297d8aaedac224e0.zip |
Ensuring that ShortcutInfo always has an icon
> Making iconBitmap public instead of a getter (similar to AppInfo)
> Removing getIcon() which can lead to IO on UI thread
> Removing updateIcon and handling the update at the caller
Bug: 21325319
Change-Id: I6a49b9043f974e9629ea25e77012d97cc04c0594
Diffstat (limited to 'src/com/android/launcher3/BubbleTextView.java')
-rw-r--r-- | src/com/android/launcher3/BubbleTextView.java | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/com/android/launcher3/BubbleTextView.java b/src/com/android/launcher3/BubbleTextView.java index 51cd0527f..0c1a156ad 100644 --- a/src/com/android/launcher3/BubbleTextView.java +++ b/src/com/android/launcher3/BubbleTextView.java @@ -155,13 +155,12 @@ public class BubbleTextView extends TextView setAccessibilityDelegate(mLauncher.getAccessibilityDelegate()); } - public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache) { - applyFromShortcutInfo(info, iconCache, false); + public void applyFromShortcutInfo(ShortcutInfo info) { + applyFromShortcutInfo(info, false); } - public void applyFromShortcutInfo(ShortcutInfo info, IconCache iconCache, - boolean promiseStateChanged) { - applyIconAndLabel(info.getIcon(iconCache), info); + public void applyFromShortcutInfo(ShortcutInfo info, boolean promiseStateChanged) { + applyIconAndLabel(info.iconBitmap, info); setTag(info); if (promiseStateChanged || info.isPromise()) { applyState(promiseStateChanged); @@ -557,8 +556,7 @@ public class BubbleTextView extends TextView if (info instanceof AppInfo) { applyFromApplicationInfo((AppInfo) info); } else if (info instanceof ShortcutInfo) { - applyFromShortcutInfo((ShortcutInfo) info, - LauncherAppState.getInstance().getIconCache()); + applyFromShortcutInfo((ShortcutInfo) info); if ((info.rank < FolderIcon.NUM_ITEMS_IN_PREVIEW) && (info.container >= 0)) { View folderIcon = mLauncher.getWorkspace().getHomescreenIconByItemId(info.container); |