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
diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java
index ed225c9..dcc7a9d 100644
--- a/src/com/android/launcher3/PagedView.java
+++ b/src/com/android/launcher3/PagedView.java
@@ -408,9 +408,10 @@
if (getChildCount() == 0) {
return;
}
+ int prevPage = mCurrentPage;
mCurrentPage = validateNewPage(currentPage);
updateCurrentPageScroll();
- notifyPageSwitchListener();
+ notifyPageSwitchListener(prevPage);
invalidate();
}
@@ -418,7 +419,7 @@
* Should be called whenever the page changes. In the case of a scroll, we wait until the page
* has settled.
*/
- protected void notifyPageSwitchListener() {
+ protected void notifyPageSwitchListener(int prevPage) {
updatePageIndicator();
}
@@ -585,9 +586,10 @@
} else if (mNextPage != INVALID_PAGE && shouldInvalidate) {
sendScrollAccessibilityEvent();
+ int prevPage = mCurrentPage;
mCurrentPage = validateNewPage(mNextPage);
mNextPage = INVALID_PAGE;
- notifyPageSwitchListener();
+ notifyPageSwitchListener(prevPage);
// We don't want to trigger a page end moving unless the page has settled
// and the user has stopped scrolling