summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-09-01 12:47:12 -0700
committerHyunyoung Song <hyunyoungs@google.com>2016-09-01 12:47:12 -0700
commit59a238095e82fd02355f4cb53abe01655a50b051 (patch)
tree59aed70bde91588fff3a51c2940c42fb814d6d07 /src/com/android/launcher3/dragndrop
parent4a4b49ff3482cbe7f8192807cdc99437810fe518 (diff)
downloadandroid_packages_apps_Trebuchet-59a238095e82fd02355f4cb53abe01655a50b051.tar.gz
android_packages_apps_Trebuchet-59a238095e82fd02355f4cb53abe01655a50b051.tar.bz2
android_packages_apps_Trebuchet-59a238095e82fd02355f4cb53abe01655a50b051.zip
Support user event logging for drag and drop
b/30039490 Supported in this CL: - DnD: drag from container [WORKSPACE|HOTSEAT|FOLDER|ALLAPPS|WIDGETS|DEEPSHORTCUTS] drag to container [HOTSEAT,WORKSPACE,FOLDER,DROPTARGETS] - Source and target can be [FOLDER_ICON, ICON, DEEPSHORTCUT, WIDGET] - $ adb shell setprop log.tag.UserEvent DEBUG will turn on debugging Change-Id: I0b8b879b80e6dce85bbde6e7794f9e0677832603
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r--src/com/android/launcher3/dragndrop/DragController.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java
index 9da1cb313..b57f5bf06 100644
--- a/src/com/android/launcher3/dragndrop/DragController.java
+++ b/src/com/android/launcher3/dragndrop/DragController.java
@@ -43,7 +43,6 @@ import com.android.launcher3.PagedView;
import com.android.launcher3.R;
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.ItemInfoMatcher;
@@ -51,7 +50,6 @@ import com.android.launcher3.util.Thunk;
import com.android.launcher3.util.TouchController;
import java.util.ArrayList;
-import java.util.HashSet;
/**
* Class for initiating a drag within a view or across multiple views.
@@ -271,6 +269,8 @@ public class DragController implements DragDriver.EventListener, TouchController
mDragObject.dragSource = source;
mDragObject.dragInfo = dragInfo;
+ mDragObject.originalDragInfo = new ItemInfo();
+ mDragObject.originalDragInfo.copyFrom(dragInfo);
if (dragOffset != null) {
dragView.setDragVisualizeOffset(new Point(dragOffset));
@@ -285,6 +285,7 @@ public class DragController implements DragDriver.EventListener, TouchController
mLastTouch[0] = mMotionDownX;
mLastTouch[1] = mMotionDownY;
handleMoveEvent(mMotionDownX, mMotionDownY);
+ mLauncher.getUserEventDispatcher().resetActionDurationMillis();
return dragView;
}
@@ -507,7 +508,7 @@ public class DragController implements DragDriver.EventListener, TouchController
*/
public void setMoveTarget(View view) {
mMoveTarget = view;
- }
+ }
public boolean dispatchUnhandledMove(View focused, int direction) {
return mMoveTarget != null && mMoveTarget.dispatchUnhandledMove(focused, direction);
@@ -734,6 +735,7 @@ public class DragController implements DragDriver.EventListener, TouchController
final View dropTargetAsView = dropTarget instanceof View ? (View) dropTarget : null;
mDragObject.dragSource.onDropCompleted(
dropTargetAsView, mDragObject, flingVel != null, accepted);
+ mLauncher.getUserEventDispatcher().logDragNDrop(mDragObject, dropTargetAsView);
}
private DropTarget findDropTarget(int x, int y, int[] dropCoordinates) {