summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/Workspace.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-10-06 16:23:56 -0700
committerDanesh M <daneshm90@gmail.com>2015-09-27 15:12:53 -0700
commit88699b6191c6e8f75b0cc64cce5313fc31ed1348 (patch)
tree538245db0ac03dcd0787ab8517bbd788eb935f8d /src/com/android/launcher3/Workspace.java
parent19b63da9550dd4734f2df0e663dc8009b29705a0 (diff)
downloadandroid_packages_apps_Trebuchet-88699b6191c6e8f75b0cc64cce5313fc31ed1348.tar.gz
android_packages_apps_Trebuchet-88699b6191c6e8f75b0cc64cce5313fc31ed1348.tar.bz2
android_packages_apps_Trebuchet-88699b6191c6e8f75b0cc64cce5313fc31ed1348.zip
Updating icons for sortcuts when the target app updates.
Bug: 17398260 Change-Id: I055abb971d1f72245e8616ac2ce07bcdf37cdd52
Diffstat (limited to 'src/com/android/launcher3/Workspace.java')
-rw-r--r--src/com/android/launcher3/Workspace.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index acb1d3965..5efe8d41c 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -5086,6 +5086,28 @@ public class Workspace extends SmoothPagedView
}
}
+
+ void updateShortcuts(ArrayList<ShortcutInfo> shortcuts) {
+ final HashSet<ShortcutInfo> updates = new HashSet<ShortcutInfo>(shortcuts);
+ mapOverItems(MAP_RECURSE, new ItemOperator() {
+ @Override
+ public boolean evaluate(ItemInfo info, View v, View parent) {
+ if (info instanceof ShortcutInfo && v instanceof BubbleTextView &&
+ updates.contains(info)) {
+ ShortcutInfo shortcutInfo = (ShortcutInfo) info;
+ BubbleTextView shortcut = (BubbleTextView) v;
+ shortcut.applyFromShortcutInfo(shortcutInfo, mIconCache, true, false);
+
+ if (parent != null) {
+ parent.invalidate();
+ }
+ }
+ // process all the shortcuts
+ return false;
+ }
+ });
+ }
+
void updateShortcutsAndWidgets(ArrayList<AppInfo> apps) {
// Break the appinfo list per user
final HashMap<UserHandleCompat, ArrayList<AppInfo>> appsPerUser =