diff options
author | Michael Jurka <mikejurka@google.com> | 2012-03-09 15:59:25 -0800 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-03-09 15:59:25 -0800 |
commit | e384affda684a48c61d99ebfe8be40fb7d46d761 (patch) | |
tree | a18ad7cfe0d941939de00f8ef5339df0676613d4 /src | |
parent | 9e371e95f1348041abdd9b197f7ad8a9c2bcb766 (diff) | |
download | android_packages_apps_Trebuchet-e384affda684a48c61d99ebfe8be40fb7d46d761.tar.gz android_packages_apps_Trebuchet-e384affda684a48c61d99ebfe8be40fb7d46d761.tar.bz2 android_packages_apps_Trebuchet-e384affda684a48c61d99ebfe8be40fb7d46d761.zip |
Fix case where shortcut label wasn't updating
When installing an updated version of an app,
update the title (we were previously only doing
the icon).
Bug: 6069921
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher2/ShortcutInfo.java | 8 | ||||
-rw-r--r-- | src/com/android/launcher2/Workspace.java | 12 |
2 files changed, 12 insertions, 8 deletions
diff --git a/src/com/android/launcher2/ShortcutInfo.java b/src/com/android/launcher2/ShortcutInfo.java index c0f80aeec..ff3028beb 100644 --- a/src/com/android/launcher2/ShortcutInfo.java +++ b/src/com/android/launcher2/ShortcutInfo.java @@ -93,12 +93,16 @@ class ShortcutInfo extends ItemInfo { public Bitmap getIcon(IconCache iconCache) { if (mIcon == null) { - mIcon = iconCache.getIcon(this.intent); - this.usingFallbackIcon = iconCache.isDefaultIcon(mIcon); + updateIcon(iconCache); } return mIcon; } + public void updateIcon(IconCache iconCache) { + mIcon = iconCache.getIcon(intent); + usingFallbackIcon = iconCache.isDefaultIcon(mIcon); + } + /** * Creates the application intent based on a component name and various launch flags. * Sets {@link #itemType} to {@link LauncherSettings.BaseLauncherColumns#ITEM_TYPE_APPLICATION}. diff --git a/src/com/android/launcher2/Workspace.java b/src/com/android/launcher2/Workspace.java index b7fdfe8bb..4e9b955ce 100644 --- a/src/com/android/launcher2/Workspace.java +++ b/src/com/android/launcher2/Workspace.java @@ -3483,7 +3483,7 @@ public class Workspace extends SmoothPagedView final View view = layout.getChildAt(j); Object tag = view.getTag(); if (tag instanceof ShortcutInfo) { - ShortcutInfo info = (ShortcutInfo)tag; + ShortcutInfo info = (ShortcutInfo) tag; // We need to check for ACTION_MAIN otherwise getComponent() might // return null for some shortcuts (for instance, for shortcuts to // web pages.) @@ -3495,11 +3495,11 @@ public class Workspace extends SmoothPagedView for (int k = 0; k < appCount; k++) { ApplicationInfo app = apps.get(k); if (app.componentName.equals(name)) { - info.setIcon(mIconCache.getIcon(info.intent)); - ((TextView)view).setCompoundDrawablesWithIntrinsicBounds(null, - new FastBitmapDrawable(info.getIcon(mIconCache)), - null, null); - } + BubbleTextView shortcut = (BubbleTextView) view; + info.updateIcon(mIconCache); + info.title = app.title.toString(); + shortcut.applyFromShortcutInfo(info, mIconCache); + } } } } |