Add user event logging for page rearrangement and LEFT/RIGHT swipes

1. Call logOverviewRearrange logging call ONLY when the order actually changed
2. Call logActionOnContainer when containers are swiped.
Bug: 32457561
Bug: 32457561

06-30 11:23:04.082  6585  6585 D UserEvent: action:SWIPE direction=LEFT
06-30 11:23:04.082  6585  6585 D UserEvent:  Source child:WORKSPACE id=2
06-30 11:23:04.082  6585  6585 D UserEvent:  Elapsed container 50436 ms session 50436 ms action 0 ms
06-30 11:23:04.082  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:04.082  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:08.266  6585  6585 D UserEvent: action:SWIPE direction=LEFT
06-30 11:23:08.266  6585  6585 D UserEvent:  Source child:WORKSPACE id=1
06-30 11:23:08.266  6585  6585 D UserEvent:  Elapsed container 54620 ms session 54620 ms action 0 ms
06-30 11:23:08.266  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:08.266  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:10.742  6585  6585 D UserEvent: action:SWIPE direction=LEFT
06-30 11:23:10.742  6585  6585 D UserEvent:  Source child:WORKSPACE id=0
06-30 11:23:10.742  6585  6585 D UserEvent:  Elapsed container 57096 ms session 57096 ms action 0 ms
06-30 11:23:10.742  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:10.742  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:17.286  6585  6585 D UserEvent: action:SWIPE direction=RIGHT
06-30 11:23:17.286  6585  6585 D UserEvent:  Source child:WORKSPACE id=-1
06-30 11:23:17.286  6585  6585 D UserEvent:  Elapsed container 63639 ms session 63639 ms action 0 ms
06-30 11:23:17.286  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:17.286  6585  6585 D UserEvent:  isInMultiWindowMode false
06-30 11:23:19.879  6585  6585 D UserEvent: action:SWIPE direction=RIGHT
06-30 11:23:19.879  6585  6585 D UserEvent:  Source child:WORKSPACE id=0
06-30 11:23:19.879  6585  6585 D UserEvent:  Elapsed container 66233 ms session 66233 ms action 0 ms
06-30 11:23:19.879  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:19.879  6585  6585 D UserEvent:  isInMultiWindowMode false

06-30 11:23:23.811  6585  6585 D UserEvent: action:SWIPE direction=RIGHT
06-30 11:23:23.811  6585  6585 D UserEvent:  Source child:WORKSPACE id=1
06-30 11:23:23.811  6585  6585 D UserEvent:  Elapsed container 70165 ms session 70165 ms action 0 ms
06-30 11:23:23.811  6585  6585 D UserEvent:  isInLandscapeMode false
06-30 11:23:23.811  6585  6585 D UserEvent:  isInMultiWindowMode false


Change-Id: I11a48ee44aaa87863e76ccf2b46f499c28e96748
This commit is contained in:
Hyunyoung Song committed 2017-06-30 13:59:38 -07:00
1 parent 20c55b0e87
commit 3f5a11f3a5
4 files changed
+45 -10

No files matched your search

+31 -4
View File
@@ -75,6 +75,7 @@ import com.android.launcher3.graphics.DragPreviewProvider;
import com.android.launcher3.graphics.PreloadIconDrawable;
import com.android.launcher3.popup.PopupContainerWithArrow;
import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action;
import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.userevent.nano.LauncherLogProto.Target;
import com.android.launcher3.util.ItemInfoMatcher;
@@ -300,6 +301,7 @@ public class Workspace extends PagedView
boolean mScrollInteractionBegan;
boolean mStartedSendingScrollEvents;
float mLastOverlayScroll = 0;
boolean mOverlayShown = false;
private boolean mForceDrawAdjacentPages = false;
// Total over scrollX in the overlay direction.
@@ -1405,6 +1407,20 @@ public class Workspace extends PagedView
* The overlay scroll is being controlled locally, just update our overlay effect
*/
public void onOverlayScrollChanged(float scroll) {
if (Float.compare(scroll, 1f) == 0) {
if (!mOverlayShown) {
mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE,
Action.Direction.LEFT, ContainerType.WORKSPACE, 0);
}
mOverlayShown = true;
} else if (Float.compare(scroll, 0f) == 0) {
if (mOverlayShown) {
mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE,
Action.Direction.RIGHT, ContainerType.WORKSPACE, -1);
}
mOverlayShown = false;
}
float offset = 0f;
float slip = 0f;
@@ -1515,9 +1531,13 @@ public class Workspace extends PagedView
}
@Override
protected void notifyPageSwitchListener() {
super.notifyPageSwitchListener();
protected void notifyPageSwitchListener(int prevPage) {
super.notifyPageSwitchListener(prevPage);
if (prevPage != mCurrentPage) {
int swipeDirection = (prevPage < mCurrentPage) ? Action.Direction.RIGHT : Action.Direction.LEFT;
mLauncher.getUserEventDispatcher().logActionOnContainer(Action.Touch.SWIPE,
swipeDirection, ContainerType.WORKSPACE, prevPage);
}
if (hasCustomContent() && getNextPage() == 0 && !mCustomContentShowing) {
mCustomContentShowing = true;
if (mCustomContentCallbacks != null) {
@@ -1867,13 +1887,20 @@ public class Workspace extends PagedView
return;
}
ArrayList<Long> prevScreenOrder = (ArrayList<Long>) mScreenOrder.clone();
mScreenOrder.clear();
int count = getChildCount();
for (int i = 0; i < count; i++) {
CellLayout cl = ((CellLayout) getChildAt(i));
mScreenOrder.add(getIdForScreen(cl));
}
mLauncher.getUserEventDispatcher().logOverviewReorder();
for (int i = 0; i < prevScreenOrder.size(); i++) {
if (mScreenOrder.get(i) != prevScreenOrder.get(i)) {
mLauncher.getUserEventDispatcher().logOverviewReorder();
break;
}
}
LauncherModel.updateWorkspaceScreenOrder(mLauncher, mScreenOrder);
// Re-enable auto layout transitions for page deletion.