Merge "Instrumenting swiping up to all apps for jank" into sc-dev

This commit is contained in:
Vadim Tryshev
2021-02-23 18:32:23 +00:00
committed by Android (Google) Code Review
2 changed files with 51 additions and 1 deletions

View File

@@ -124,7 +124,7 @@ public abstract class AbstractStateChangeTouchController
protected abstract boolean canInterceptTouch(MotionEvent ev);
@Override
public final boolean onControllerInterceptTouchEvent(MotionEvent ev) {
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
mNoIntercept = !canInterceptTouch(ev);
if (mNoIntercept) {
@@ -193,6 +193,8 @@ public abstract class AbstractStateChangeTouchController
: reachedToState ? mToState : mFromState;
LauncherState newToState = getTargetState(newFromState, isDragTowardPositive);
onReinitToState(newToState);
if (newFromState == mFromState && newToState == mToState || (newFromState == newToState)) {
return false;
}
@@ -231,6 +233,12 @@ public abstract class AbstractStateChangeTouchController
return true;
}
protected void onReinitToState(LauncherState newToState) {
}
protected void onReachedFinalState(LauncherState newToState) {
}
protected boolean goingBetweenNormalAndOverview(LauncherState fromState,
LauncherState toState) {
return (fromState == NORMAL || fromState == OVERVIEW)
@@ -527,6 +535,7 @@ public abstract class AbstractStateChangeTouchController
mAtomicComponentsController.getAnimationPlayer().end();
mAtomicComponentsController = null;
}
onReachedFinalState(mToState);
clearState();
boolean shouldGoToTargetState = mGoingBetweenStates || (mToState != targetState);
if (shouldGoToTargetState) {