diff options
author | Tony Wickham <twickham@google.com> | 2016-05-19 11:19:39 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-06-21 15:49:16 -0700 |
commit | bfbf7f9f4a0b300613f0ff27a4eb592d88c08325 (patch) | |
tree | 6906865484b6a03199eecd0f352eba24345af33e /src/com/android/launcher3/folder | |
parent | ae50284e0a838139c67caf0064a0977c871497fa (diff) | |
download | android_packages_apps_Trebuchet-bfbf7f9f4a0b300613f0ff27a4eb592d88c08325.tar.gz android_packages_apps_Trebuchet-bfbf7f9f4a0b300613f0ff27a4eb592d88c08325.tar.bz2 android_packages_apps_Trebuchet-bfbf7f9f4a0b300613f0ff27a4eb592d88c08325.zip |
Add support for launcher shortcuts.
- This CL has no UI but provides the necessary backing for one.
- Adds new item type: ITEM_TYPE_DEEP_SHORTCUT, to distinguish from
ITEM_TYPE_SHORTCUT. We can reconsider these names.
- Adds ShortcutCache, using LruCache for up to 30 dynamic shortcuts
(pinned shortcuts are always cached in a HashMap).
- DeepShortcutManager queries for shortcuts and other things like
pin them. In a future CL it will use the cache, but for now it
simply makes an RPC for all queries.
- LauncherModel maintains counts for pinned shortcuts, pinning and
unpinning when counts reach 1 or 0, respectively.
- LauncherModel maintains a map of components to lists of shortcut ids,
which Launcher gets a copy of after it is changed in the background.
This will allow us to know how many shortcuts an app has immediately,
and query for details as the UI is animating.
Change-Id: Ic526f374dd10d72a261bae67f07f098fca8d8bca
Diffstat (limited to 'src/com/android/launcher3/folder')
-rw-r--r-- | src/com/android/launcher3/folder/Folder.java | 5 | ||||
-rw-r--r-- | src/com/android/launcher3/folder/FolderIcon.java | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 93238de86..2035f9960 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -510,7 +510,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList } // This is set to true in close(), but isn't reset to false until onDropCompleted(). This - // leads to an consistent state if you drag out of the folder and drag back in without + // leads to an inconsistent state if you drag out of the folder and drag back in without // dropping. One resulting issue is that replaceFolderWithFinalItem() can be called twice. mDeleteFolderOnDropCompleted = false; @@ -737,7 +737,8 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList final ItemInfo item = d.dragInfo; final int itemType = item.itemType; return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION || - itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && + itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT || + itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) && !isFull()); } diff --git a/src/com/android/launcher3/folder/FolderIcon.java b/src/com/android/launcher3/folder/FolderIcon.java index d7952c570..d08cf548e 100644 --- a/src/com/android/launcher3/folder/FolderIcon.java +++ b/src/com/android/launcher3/folder/FolderIcon.java @@ -213,7 +213,8 @@ public class FolderIcon extends FrameLayout implements FolderListener { private boolean willAcceptItem(ItemInfo item) { final int itemType = item.itemType; return ((itemType == LauncherSettings.Favorites.ITEM_TYPE_APPLICATION || - itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT) && + itemType == LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT || + itemType == LauncherSettings.Favorites.ITEM_TYPE_DEEP_SHORTCUT) && !mFolder.isFull() && item != mInfo && !mInfo.opened); } |