summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop/DragController.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-04-28 17:39:03 -0700
committerTony Wickham <twickham@google.com>2016-06-29 17:48:46 -0700
commit1bce7fd342875be8f7c1f82c8cf21d0199c8d544 (patch)
tree44871413914606a046e9f4dcf24d3ee3bd1a8756 /src/com/android/launcher3/dragndrop/DragController.java
parent3ccedd234acb1534190c596351cf293e8ef4727a (diff)
downloadandroid_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/dragndrop/DragController.java')
-rw-r--r--src/com/android/launcher3/dragndrop/DragController.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index af5ff587a..dc93bca72 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -45,6 +45,7 @@ import com.android.launcher3.ShortcutInfo;
import com.android.launcher3.Utilities;
import com.android.launcher3.Workspace;
import com.android.launcher3.accessibility.DragViewStateAnnouncer;
+import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.TouchController;
@@ -247,9 +248,12 @@ public class DragController implements DragDriver.EventListener, TouchController
mDragObject = new DropTarget.DragObject();
+ final Resources res = mLauncher.getResources();
+ final float scaleDps = FeatureFlags.LAUNCHER3_LEGACY_WORKSPACE_DND ?
+ res.getDimensionPixelSize(R.dimen.dragViewScale) : 0f;
final DragView dragView = mDragObject.dragView = new DragView(mLauncher, b, registrationX,
registrationY, 0, 0, b.getWidth(), b.getHeight(),
- initialDragViewScale);
+ initialDragViewScale, scaleDps);
mDragObject.dragComplete = false;
if (mIsAccessibleDrag) {
@@ -284,6 +288,10 @@ public class DragController implements DragDriver.EventListener, TouchController
return dragView;
}
+ public Point getMotionDown() {
+ return new Point(mMotionDownX, mMotionDownY);
+ }
+
/**
* Call this from a drag source view like this:
*