diff options
author | Tony Wickham <twickham@google.com> | 2016-04-28 17:39:03 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-06-29 17:48:46 -0700 |
commit | 1bce7fd342875be8f7c1f82c8cf21d0199c8d544 (patch) | |
tree | 44871413914606a046e9f4dcf24d3ee3bd1a8756 /src/com/android/launcher3/folder | |
parent | 3ccedd234acb1534190c596351cf293e8ef4727a (diff) | |
download | android_packages_apps_Trebuchet-1bce7fd342875be8f7c1f82c8cf21d0199c8d544.tar.gz android_packages_apps_Trebuchet-1bce7fd342875be8f7c1f82c8cf21d0199c8d544.tar.bz2 android_packages_apps_Trebuchet-1bce7fd342875be8f7c1f82c8cf21d0199c8d544.zip |
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
Diffstat (limited to 'src/com/android/launcher3/folder')
-rw-r--r-- | src/com/android/launcher3/folder/Folder.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/folder/FolderPagedView.java | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 2035f9960..e94e02f91 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -25,7 +25,6 @@ import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.Context; import android.content.res.Resources; -import android.graphics.Point; import android.graphics.PointF; import android.graphics.Rect; import android.os.Build; @@ -295,7 +294,7 @@ public class Folder extends LinearLayout implements DragSource, View.OnClickList return false; } - mLauncher.getWorkspace().beginDragShared(v, new Point(), this, accessible); + mLauncher.getWorkspace().beginDragShared(v, this, accessible); mCurrentDragInfo = item; mEmptyCellRank = item.rank; diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java index c6fc4cb63..82c79a9ec 100644 --- a/src/com/android/launcher3/folder/FolderPagedView.java +++ b/src/com/android/launcher3/folder/FolderPagedView.java @@ -46,6 +46,8 @@ import com.android.launcher3.Workspace.ItemOperator; import com.android.launcher3.dragndrop.DragController; import com.android.launcher3.pageindicators.PageIndicator; import com.android.launcher3.keyboard.ViewGroupFocusHelper; +import com.android.launcher3.shortcuts.DeepShortcutManager; +import com.android.launcher3.shortcuts.ShortcutsContainerListener; import com.android.launcher3.util.Thunk; import java.util.ArrayList; @@ -234,6 +236,10 @@ public class FolderPagedView extends PagedView { textView.applyFromShortcutInfo(item, mIconCache); textView.setOnClickListener(mFolder); textView.setOnLongClickListener(mFolder); + if (DeepShortcutManager.supportsShortcuts(item)) { + // TODO: only add this listener if the item has shortcuts associated with it. + textView.setOnTouchListener(new ShortcutsContainerListener(textView)); + } textView.setOnFocusChangeListener(mFocusIndicatorHelper); textView.setOnKeyListener(mKeyListener); |