summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherModel.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-07-20 15:42:44 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-07-26 14:18:09 -0700
commit10923b30a22b4ec8d10cf8536bddf3f176e6c26f (patch)
tree4577358d961ca4b9349d76b04672136301492015 /src/com/android/launcher3/LauncherModel.java
parent2f88ef34fb47b2ef96055ed2234a696fb83c1019 (diff)
downloadandroid_packages_apps_Trebuchet-10923b30a22b4ec8d10cf8536bddf3f176e6c26f.tar.gz
android_packages_apps_Trebuchet-10923b30a22b4ec8d10cf8536bddf3f176e6c26f.tar.bz2
android_packages_apps_Trebuchet-10923b30a22b4ec8d10cf8536bddf3f176e6c26f.zip
Removing shadow and badging from the icon which is shown in the menu
These are added as soon as the icon is added to the workspace Bug: 28980830 Change-Id: I725d2ee8994324f09d9ecf7bbbb0090a7ceb5769
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r--src/com/android/launcher3/LauncherModel.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java
index ddd60c89c..456111115 100644
--- a/src/com/android/launcher3/LauncherModel.java
+++ b/src/com/android/launcher3/LauncherModel.java
@@ -1957,8 +1957,7 @@ public class LauncherModel extends BroadcastReceiver
}
}
incrementPinnedShortcutCount(key, shouldPin);
- info = ShortcutInfo.fromDeepShortcutInfo(
- pinnedShortcut, context);
+ info = new ShortcutInfo(pinnedShortcut, context);
} else { // item type == ITEM_TYPE_SHORTCUT
info = getShortcutInfo(c, context, titleIndex, cursorIconInfo);
@@ -3291,6 +3290,22 @@ public class LauncherModel extends BroadcastReceiver
}
}
+ /**
+ * Repopulates the shortcut info, possibly updating any icon already on the workspace.
+ */
+ public void updateShortcutInfo(final ShortcutInfoCompat fullDetail, final ShortcutInfo info) {
+ enqueueItemUpdatedTask(new Runnable() {
+ @Override
+ public void run() {
+ info.updateFromDeepShortcutInfo(
+ fullDetail, LauncherAppState.getInstance().getContext());
+ ArrayList<ShortcutInfo> update = new ArrayList<ShortcutInfo>();
+ update.add(info);
+ bindUpdatedShortcuts(update, fullDetail.getUserHandle());
+ }
+ });
+ }
+
private class ShortcutsChangedTask implements Runnable {
private String mPackageName;
private List<ShortcutInfoCompat> mShortcuts;