summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2018-05-23 13:20:10 -0700
committerTony Wickham <twickham@google.com>2018-05-23 13:20:10 -0700
commit422e1f9c69efdbc7ccfe10e8ebdadcf30a25022e (patch)
tree8ad45b4c0802a559f9cb214ea2f55eb2e809666e
parente47fc65716173da730f35b6adac749816a0ad52e (diff)
downloadandroid_packages_apps_Trebuchet-422e1f9c69efdbc7ccfe10e8ebdadcf30a25022e.tar.gz
android_packages_apps_Trebuchet-422e1f9c69efdbc7ccfe10e8ebdadcf30a25022e.tar.bz2
android_packages_apps_Trebuchet-422e1f9c69efdbc7ccfe10e8ebdadcf30a25022e.zip
Only log swipe interaction on swipe end
Previously we were logging new states as we swipe past them; now we just log the start and end states when lifting your finger. Bug: 80102083 Change-Id: Icec6c3dab1441023a3cdcadb7b56ecef8313cb8c
-rw-r--r--src/com/android/launcher3/touch/AbstractStateChangeTouchController.java38
1 files changed, 16 insertions, 22 deletions
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index a9006e314..453810c06 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -42,9 +42,9 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.AnimatorSetBuilder;
+import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
-import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType;
import com.android.launcher3.util.FlingBlockCheck;
import com.android.launcher3.util.PendingAnimation;
import com.android.launcher3.util.TouchController;
@@ -181,17 +181,6 @@ public abstract class AbstractStateChangeTouchController
return false;
}
- if (reachedToState) {
- logReachedState(Touch.SWIPE);
- }
- if (newFromState == ALL_APPS) {
- mStartContainerType = ContainerType.ALLAPPS;
- } else if (newFromState == NORMAL) {
- mStartContainerType = getLogContainerTypeForNormalState();
- } else if (newFromState == OVERVIEW){
- mStartContainerType = ContainerType.TASKSWITCHER;
- }
-
mFromState = newFromState;
mToState = newToState;
@@ -237,6 +226,13 @@ public abstract class AbstractStateChangeTouchController
@Override
public void onDragStart(boolean start) {
mStartState = mLauncher.getStateManager().getState();
+ if (mStartState == ALL_APPS) {
+ mStartContainerType = LauncherLogProto.ContainerType.ALLAPPS;
+ } else if (mStartState == NORMAL) {
+ mStartContainerType = getLogContainerTypeForNormalState();
+ } else if (mStartState == OVERVIEW){
+ mStartContainerType = LauncherLogProto.ContainerType.TASKSWITCHER;
+ }
if (mCurrentAnimation == null) {
mFromState = mStartState;
mToState = null;
@@ -332,23 +328,21 @@ public abstract class AbstractStateChangeTouchController
@Override
public void onDragEnd(float velocity, boolean fling) {
- final int logAction;
- final LauncherState targetState;
- final float progress = mCurrentAnimation.getProgressFraction();
+ final int logAction = fling ? Touch.FLING : Touch.SWIPE;
boolean blockedFling = fling && mFlingBlockCheck.isBlocked();
if (blockedFling) {
fling = false;
}
+ final LauncherState targetState;
+ final float progress = mCurrentAnimation.getProgressFraction();
if (fling) {
- logAction = Touch.FLING;
targetState =
Float.compare(Math.signum(velocity), Math.signum(mProgressMultiplier)) == 0
? mToState : mFromState;
// snap to top or bottom using the release velocity
} else {
- logAction = Touch.SWIPE;
float successProgress = mToState == ALL_APPS
? MIN_PROGRESS_TO_ALL_APPS : SUCCESS_TRANSITION_PROGRESS;
targetState = (progress > successProgress) ? mToState : mFromState;
@@ -472,20 +466,20 @@ public abstract class AbstractStateChangeTouchController
shouldGoToTargetState = !reachedTarget;
}
if (shouldGoToTargetState) {
- if (targetState != mFromState) {
- logReachedState(logAction);
+ if (targetState != mStartState) {
+ logReachedState(logAction, targetState);
}
mLauncher.getStateManager().goToState(targetState, false /* animated */);
}
}
- private void logReachedState(int logAction) {
+ private void logReachedState(int logAction, LauncherState targetState) {
// Transition complete. log the action
mLauncher.getUserEventDispatcher().logStateChangeAction(logAction,
getDirectionForLog(),
mStartContainerType,
- mFromState.containerType,
- mToState.containerType,
+ mStartState.containerType,
+ targetState.containerType,
mLauncher.getWorkspace().getCurrentPage());
}