Merge "Fix case where shortcut label wasn't updating"
diff --git a/src/com/android/launcher2/ShortcutInfo.java b/src/com/android/launcher2/ShortcutInfo.java
index c0f80ae..ff3028b 100644
--- a/src/com/android/launcher2/ShortcutInfo.java
+++ b/src/com/android/launcher2/ShortcutInfo.java
@@ -93,12 +93,16 @@
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 b7fdfe8..4e9b955 100644
--- a/src/com/android/launcher2/Workspace.java
+++ b/src/com/android/launcher2/Workspace.java
@@ -3483,7 +3483,7 @@
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 @@
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);
+ }
}
}
}