summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop/DragController.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2016-09-01 21:51:25 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-09-01 21:51:25 +0000
commit61bcfba33598ddd0bc59910ab758fcd51d770502 (patch)
tree5aa5b8620ed3e8192200abe95d22779637edd7e0 /src/com/android/launcher3/dragndrop/DragController.java
parent3cc2d8b3dd0562539a7a988e1b5e6d4bd225ee1f (diff)
parent59a238095e82fd02355f4cb53abe01655a50b051 (diff)
downloadandroid_packages_apps_Trebuchet-61bcfba33598ddd0bc59910ab758fcd51d770502.tar.gz
android_packages_apps_Trebuchet-61bcfba33598ddd0bc59910ab758fcd51d770502.tar.bz2
android_packages_apps_Trebuchet-61bcfba33598ddd0bc59910ab758fcd51d770502.zip
Merge "Support user event logging for drag and drop b/30039490" into ub-launcher3-calgary-polish
Diffstat (limited to 'src/com/android/launcher3/dragndrop/DragController.java')
-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) {