Long-press on an app to reveal its shortcuts.
- Add ShortcutsContainerListener to icons on workspace, folders, and all apps. This handles long-press and forwards following touches to the DeepShortcutsContainer that is created. - Drag over shortcut before lifting finger to launch it. - Shortcuts are rendered in pill-shaped DeepShortcutViews, which are inside DeepShortcutContainer on DragLayer. - The shortcut container orients above or below the icon, and left or right-aligns with it. Biases for above + left-align. - Long press a DeepShortcutPill to drag and pin it to the workspace. Bug: 28980830 Change-Id: I08658d13ae51fe53064644e8d8f7b42f150fdd7d
This commit is contained in:
@@ -77,7 +77,8 @@ import com.android.launcher3.dragndrop.SpringLoadedDragController;
|
||||
import com.android.launcher3.folder.Folder;
|
||||
import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.logging.UserEventDispatcher;
|
||||
import com.android.launcher3.pageindicators.PageIndicator;
|
||||
import com.android.launcher3.shortcuts.DeepShortcutManager;
|
||||
import com.android.launcher3.shortcuts.ShortcutsContainerListener;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto;
|
||||
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
|
||||
import com.android.launcher3.util.LongArrayMap;
|
||||
@@ -1094,6 +1095,10 @@ public class Workspace extends PagedView
|
||||
if (!(child instanceof Folder)) {
|
||||
child.setHapticFeedbackEnabled(false);
|
||||
child.setOnLongClickListener(mLongClickListener);
|
||||
if (child instanceof BubbleTextView && DeepShortcutManager.supportsShortcuts(info)) {
|
||||
// TODO: only add this listener if the item has shortcuts associated with it.
|
||||
child.setOnTouchListener(new ShortcutsContainerListener((BubbleTextView) child));
|
||||
}
|
||||
}
|
||||
if (child instanceof DropTarget) {
|
||||
mDragController.addDropTarget((DropTarget) child);
|
||||
|
||||
Reference in New Issue
Block a user