Merge changes I2af1792e,Ice314d46,Ib17d4a5e into sc-dev am: 7e7116278b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/13989016 Change-Id: Id2fbb744423c5160f7c7fb4d5e746325454c9f53
This commit is contained in:
commit
ffba11d89a
24 files changed
+114
-461
No files matched your search
@@ -48,10 +48,6 @@ public class BackButtonAlphaHandler implements StateHandler<LauncherState> {
|
||||
@Override
|
||||
public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
|
||||
PendingAnimation animation) {
|
||||
if (config.onlyPlayAtomicComponent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (SysUINavigationMode.getMode(mLauncher) != TWO_BUTTONS) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,6 @@ public class DepthController implements StateHandler<LauncherState>,
|
||||
public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
|
||||
PendingAnimation animation) {
|
||||
if (mSurface == null
|
||||
|| config.onlyPlayAtomicComponent()
|
||||
|| config.hasAnimationFlag(SKIP_DEPTH_CONTROLLER)
|
||||
|| mIgnoreStateChangesDuringMultiWindowAnimation) {
|
||||
return;
|
||||
|
||||
@@ -26,8 +26,6 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SC
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCRIM_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVERVIEW_PEEK;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVERVIEW_SCALE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;
|
||||
import static com.android.quickstep.views.RecentsView.RECENTS_GRID_PROGRESS;
|
||||
@@ -83,10 +81,6 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
|
||||
@Override
|
||||
public void setStateWithAnimation(LauncherState toState, StateAnimationConfig config,
|
||||
PendingAnimation builder) {
|
||||
if (!config.hasAnimationFlag(PLAY_ATOMIC_OVERVIEW_PEEK | PLAY_ATOMIC_OVERVIEW_SCALE)) {
|
||||
// The entire recents animation is played atomically.
|
||||
return;
|
||||
}
|
||||
if (config.hasAnimationFlag(SKIP_OVERVIEW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK;
|
||||
import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP;
|
||||
import static com.android.launcher3.testing.TestProtocol.HINT_STATE_ORDINAL;
|
||||
import static com.android.launcher3.testing.TestProtocol.HINT_STATE_TWO_BUTTON_ORDINAL;
|
||||
import static com.android.launcher3.testing.TestProtocol.OVERVIEW_STATE_ORDINAL;
|
||||
import static com.android.launcher3.testing.TestProtocol.QUICK_SWITCH_STATE_ORDINAL;
|
||||
import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SYSTEM_WINDOWS_REASON_HOME_KEY;
|
||||
@@ -35,6 +36,7 @@ import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SY
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.res.Configuration;
|
||||
import android.view.HapticFeedbackConstants;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.launcher3.BaseQuickstepLauncher;
|
||||
@@ -250,6 +252,11 @@ public class QuickstepLauncher extends BaseQuickstepLauncher {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HINT_STATE_TWO_BUTTON_ORDINAL: {
|
||||
getStateManager().goToState(OVERVIEW);
|
||||
getDragLayer().performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY);
|
||||
break;
|
||||
}
|
||||
case OVERVIEW_STATE_ORDINAL: {
|
||||
RecentsView rv = getOverviewPanel();
|
||||
sendCustomAccessibilityEvent(
|
||||
|
||||
+3
-1
@@ -18,6 +18,7 @@ package com.android.launcher3.uioverrides.states;
|
||||
import static android.view.View.VISIBLE;
|
||||
|
||||
import static com.android.launcher3.LauncherState.HINT_STATE;
|
||||
import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.WorkspaceStateTransitionAnimation.getSpringScaleAnimator;
|
||||
@@ -115,7 +116,8 @@ public class QuickstepAtomicAnimationFactory extends
|
||||
qsbContainer.setScaleY(0.92f);
|
||||
}
|
||||
}
|
||||
} else if ((fromState == NORMAL || fromState == HINT_STATE) && toState == OVERVIEW) {
|
||||
} else if ((fromState == NORMAL || fromState == HINT_STATE
|
||||
|| fromState == HINT_STATE_TWO_BUTTON) && toState == OVERVIEW) {
|
||||
if (SysUINavigationMode.getMode(mActivity) == NO_BUTTON) {
|
||||
config.setInterpolator(ANIM_WORKSPACE_SCALE,
|
||||
fromState == NORMAL ? ACCEL : OVERSHOOT_1_2);
|
||||
|
||||
+2
-2
@@ -108,8 +108,8 @@ public class NoButtonNavbarToOverviewTouchController extends PortraitStatesTouch
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float initCurrentAnimation(int animComponents) {
|
||||
float progressMultiplier = super.initCurrentAnimation(animComponents);
|
||||
protected float initCurrentAnimation() {
|
||||
float progressMultiplier = super.initCurrentAnimation();
|
||||
if (mToState == HINT_STATE) {
|
||||
// Track the drag across the entire height of the screen.
|
||||
progressMultiplier = -1 / getShiftRange();
|
||||
|
||||
+2
-1
@@ -33,6 +33,7 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FA
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_ALL_ANIMATIONS;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_RIGHT;
|
||||
import static com.android.launcher3.touch.BothAxesSwipeDetector.DIRECTION_UP;
|
||||
@@ -372,7 +373,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
|
||||
// animation as from an app.
|
||||
StateAnimationConfig config = new StateAnimationConfig();
|
||||
// Update mNonOverviewAnim to do nothing so it doesn't interfere.
|
||||
config.animFlags = 0;
|
||||
config.animFlags = SKIP_ALL_ANIMATIONS;
|
||||
updateNonOverviewAnim(targetState, config);
|
||||
nonOverviewAnim = mNonOverviewAnim.getAnimationPlayer();
|
||||
|
||||
|
||||
+3
-98
@@ -23,17 +23,9 @@ import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.DEACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.config.FeatureFlags.UNSTABLE_SPRINGS;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_APPS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_VERTICAL_PROGRESS;
|
||||
|
||||
import android.animation.TimeInterpolator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.util.Log;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.animation.Interpolator;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Launcher;
|
||||
@@ -41,8 +33,6 @@ import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.allapps.AllAppsTransitionController;
|
||||
import com.android.launcher3.anim.Interpolators;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.launcher3.states.StateAnimationConfig.AnimationFlags;
|
||||
import com.android.launcher3.testing.TestProtocol;
|
||||
import com.android.launcher3.touch.AbstractStateChangeTouchController;
|
||||
import com.android.launcher3.touch.SingleAxisSwipeDetector;
|
||||
import com.android.launcher3.uioverrides.states.OverviewState;
|
||||
@@ -70,11 +60,6 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
|
||||
private final PortraitOverviewStateTouchHelper mOverviewPortraitStateTouchHelper;
|
||||
|
||||
private final InterpolatorWrapper mAllAppsInterpolatorWrapper = new InterpolatorWrapper();
|
||||
|
||||
// If true, we will finish the current animation instantly on second touch.
|
||||
private boolean mFinishFastOnSecondTouch;
|
||||
|
||||
public PortraitStatesTouchController(Launcher l) {
|
||||
super(l, SingleAxisSwipeDetector.VERTICAL);
|
||||
mOverviewPortraitStateTouchHelper = new PortraitOverviewStateTouchHelper(l);
|
||||
@@ -85,10 +70,6 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
// If we are swiping to all apps instead of overview, allow it from anywhere.
|
||||
boolean interceptAnywhere = mLauncher.isInState(NORMAL);
|
||||
if (mCurrentAnimation != null) {
|
||||
if (mFinishFastOnSecondTouch) {
|
||||
mCurrentAnimation.getAnimationPlayer().end();
|
||||
}
|
||||
|
||||
AllAppsTransitionController allAppsController = mLauncher.getAllAppsController();
|
||||
if (ev.getY() >= allAppsController.getShiftRange() * allAppsController.getProgress()
|
||||
|| interceptAnywhere) {
|
||||
@@ -96,11 +77,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
// the touch is below the current all apps progress (to allow for double swipe).
|
||||
return true;
|
||||
}
|
||||
// Otherwise, make sure everything is settled and don't intercept so they can scroll
|
||||
// recents, dismiss a task, etc.
|
||||
if (mAtomicAnim != null) {
|
||||
mAtomicAnim.end();
|
||||
}
|
||||
// Otherwise, don't intercept so they can scroll recents, dismiss a task, etc.
|
||||
return false;
|
||||
}
|
||||
if (mLauncher.isInState(ALL_APPS)) {
|
||||
@@ -136,32 +113,6 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
return fromState;
|
||||
}
|
||||
|
||||
private StateAnimationConfig getNormalToOverviewAnimation() {
|
||||
mAllAppsInterpolatorWrapper.baseInterpolator = LINEAR;
|
||||
|
||||
StateAnimationConfig builder = new StateAnimationConfig();
|
||||
builder.setInterpolator(ANIM_VERTICAL_PROGRESS, mAllAppsInterpolatorWrapper);
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static StateAnimationConfig getOverviewToAllAppsAnimation() {
|
||||
StateAnimationConfig builder = new StateAnimationConfig();
|
||||
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL,
|
||||
0, ALL_APPS_CONTENT_FADE_THRESHOLD));
|
||||
builder.setInterpolator(ANIM_OVERVIEW_FADE, Interpolators.clampToProgress(DEACCEL,
|
||||
RECENTS_FADE_THRESHOLD, 1));
|
||||
return builder;
|
||||
}
|
||||
|
||||
private StateAnimationConfig getAllAppsToOverviewAnimation() {
|
||||
StateAnimationConfig builder = new StateAnimationConfig();
|
||||
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(DEACCEL,
|
||||
1 - ALL_APPS_CONTENT_FADE_THRESHOLD, 1));
|
||||
builder.setInterpolator(ANIM_OVERVIEW_FADE, Interpolators.clampToProgress(ACCEL,
|
||||
0f, 1 - RECENTS_FADE_THRESHOLD));
|
||||
return builder;
|
||||
}
|
||||
|
||||
private StateAnimationConfig getNormalToAllAppsAnimation() {
|
||||
StateAnimationConfig builder = new StateAnimationConfig();
|
||||
builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL,
|
||||
@@ -180,13 +131,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
protected StateAnimationConfig getConfigForStates(
|
||||
LauncherState fromState, LauncherState toState) {
|
||||
final StateAnimationConfig config;
|
||||
if (fromState == NORMAL && toState == OVERVIEW) {
|
||||
config = getNormalToOverviewAnimation();
|
||||
} else if (fromState == OVERVIEW && toState == ALL_APPS) {
|
||||
config = getOverviewToAllAppsAnimation();
|
||||
} else if (fromState == ALL_APPS && toState == OVERVIEW) {
|
||||
config = getAllAppsToOverviewAnimation();
|
||||
} else if (fromState == NORMAL && toState == ALL_APPS) {
|
||||
if (fromState == NORMAL && toState == ALL_APPS) {
|
||||
config = getNormalToAllAppsAnimation();
|
||||
} else if (fromState == ALL_APPS && toState == NORMAL) {
|
||||
config = getAllAppsToNormalAnimation();
|
||||
@@ -197,7 +142,7 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float initCurrentAnimation(@AnimationFlags int animFlags) {
|
||||
protected float initCurrentAnimation() {
|
||||
float range = getShiftRange();
|
||||
long maxAccuracy = (long) (2 * range);
|
||||
|
||||
@@ -208,7 +153,6 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
|
||||
final StateAnimationConfig config = totalShift == 0 ? new StateAnimationConfig()
|
||||
: getConfigForStates(mFromState, mToState);
|
||||
config.animFlags = animFlags;
|
||||
config.duration = maxAccuracy;
|
||||
|
||||
if (mCurrentAnimation != null) {
|
||||
@@ -242,35 +186,6 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
return 1 / totalShift;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateSwipeCompleteAnimation(ValueAnimator animator, long expectedDuration,
|
||||
LauncherState targetState, float velocity, boolean isFling) {
|
||||
super.updateSwipeCompleteAnimation(animator, expectedDuration, targetState,
|
||||
velocity, isFling);
|
||||
handleFirstSwipeToOverview(animator, expectedDuration, targetState, velocity, isFling);
|
||||
}
|
||||
|
||||
private void handleFirstSwipeToOverview(final ValueAnimator animator,
|
||||
final long expectedDuration, final LauncherState targetState, final float velocity,
|
||||
final boolean isFling) {
|
||||
if (UNSTABLE_SPRINGS.get() && mFromState == OVERVIEW && mToState == ALL_APPS
|
||||
&& targetState == OVERVIEW) {
|
||||
mFinishFastOnSecondTouch = true;
|
||||
} else if (mFromState == NORMAL && mToState == OVERVIEW && targetState == OVERVIEW) {
|
||||
mFinishFastOnSecondTouch = true;
|
||||
if (isFling && expectedDuration != 0) {
|
||||
// Update all apps interpolator to add a bit of overshoot starting from currFraction
|
||||
final float currFraction = mCurrentAnimation.getProgressFraction();
|
||||
mAllAppsInterpolatorWrapper.baseInterpolator = Interpolators.clampToProgress(
|
||||
Interpolators.overshootInterpolatorForVelocity(velocity), currFraction, 1);
|
||||
animator.setDuration(Math.min(expectedDuration, ATOMIC_DURATION))
|
||||
.setInterpolator(LINEAR);
|
||||
}
|
||||
} else {
|
||||
mFinishFastOnSecondTouch = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSwipeInteractionCompleted(LauncherState targetState) {
|
||||
super.onSwipeInteractionCompleted(targetState);
|
||||
@@ -296,16 +211,6 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
|
||||
return launcher.getDragLayer().getHeight() - hotseatHeight;
|
||||
}
|
||||
|
||||
private static class InterpolatorWrapper implements Interpolator {
|
||||
|
||||
public TimeInterpolator baseInterpolator = LINEAR;
|
||||
|
||||
@Override
|
||||
public float getInterpolation(float v) {
|
||||
return baseInterpolator.getInterpolation(v);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
|
||||
switch (ev.getAction()) {
|
||||
|
||||
+1
-1
@@ -101,7 +101,7 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float initCurrentAnimation(int animComponents) {
|
||||
protected float initCurrentAnimation() {
|
||||
StateAnimationConfig config = new StateAnimationConfig();
|
||||
setupInterpolators(config);
|
||||
config.duration = (long) (getShiftRange() * 2);
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ public class TransposedQuickSwitchTouchController extends QuickSwitchTouchContro
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float initCurrentAnimation(int animComponents) {
|
||||
float multiplier = super.initCurrentAnimation(animComponents);
|
||||
protected float initCurrentAnimation() {
|
||||
float multiplier = super.initCurrentAnimation();
|
||||
return mLauncher.getDeviceProfile().isSeascape() ? multiplier : -multiplier;
|
||||
}
|
||||
|
||||
|
||||
+27
-6
@@ -17,17 +17,18 @@ package com.android.launcher3.uioverrides.touchcontrollers;
|
||||
|
||||
import static com.android.launcher3.AbstractFloatingView.TYPE_ALL_APPS_EDU;
|
||||
import static com.android.launcher3.AbstractFloatingView.getOpenView;
|
||||
import static com.android.launcher3.LauncherState.HINT_STATE_TWO_BUTTON;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.os.SystemClock;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import com.android.launcher3.AbstractFloatingView;
|
||||
import com.android.launcher3.Launcher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.states.StateAnimationConfig.AnimationFlags;
|
||||
import com.android.launcher3.touch.AbstractStateChangeTouchController;
|
||||
import com.android.launcher3.touch.SingleAxisSwipeDetector;
|
||||
import com.android.quickstep.SystemUiProxy;
|
||||
@@ -91,10 +92,10 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont
|
||||
if (mIsTransposed) {
|
||||
boolean draggingFromNav =
|
||||
mLauncher.getDeviceProfile().isSeascape() == isDragTowardPositive;
|
||||
return draggingFromNav ? OVERVIEW : NORMAL;
|
||||
return draggingFromNav ? HINT_STATE_TWO_BUTTON : NORMAL;
|
||||
} else {
|
||||
LauncherState startState = mStartState != null ? mStartState : fromState;
|
||||
return isDragTowardPositive ^ (startState == OVERVIEW) ? OVERVIEW : NORMAL;
|
||||
return isDragTowardPositive ^ (startState == OVERVIEW) ? HINT_STATE_TWO_BUTTON : NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +105,12 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont
|
||||
super.updateSwipeCompleteAnimation(animator, expectedDuration, targetState,
|
||||
velocity, isFling);
|
||||
mFinishFastOnSecondTouch = !mIsTransposed && mFromState == NORMAL;
|
||||
|
||||
if (targetState == HINT_STATE_TWO_BUTTON) {
|
||||
// We were going to HINT_STATE_TWO_BUTTON, but end that animation immediately so we go
|
||||
// to OVERVIEW instead.
|
||||
animator.setDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -113,21 +120,35 @@ public class TwoButtonNavbarTouchController extends AbstractStateChangeTouchCont
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float initCurrentAnimation(@AnimationFlags int animComponent) {
|
||||
protected float initCurrentAnimation() {
|
||||
float range = getShiftRange();
|
||||
long maxAccuracy = (long) (2 * range);
|
||||
mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace(mToState,
|
||||
maxAccuracy, animComponent);
|
||||
maxAccuracy);
|
||||
return (mLauncher.getDeviceProfile().isSeascape() ? 1 : -1) / range;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateProgress(float fraction) {
|
||||
super.updateProgress(fraction);
|
||||
|
||||
// We have reached HINT_STATE, end the gesture now to go to OVERVIEW.
|
||||
if (fraction >= 1 && mToState == HINT_STATE_TWO_BUTTON) {
|
||||
final long now = SystemClock.uptimeMillis();
|
||||
MotionEvent event = MotionEvent.obtain(now, now,
|
||||
MotionEvent.ACTION_UP, 0.0f, 0.0f, 0);
|
||||
mDetector.onTouchEvent(event);
|
||||
event.recycle();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSwipeInteractionCompleted(LauncherState targetState) {
|
||||
super.onSwipeInteractionCompleted(targetState);
|
||||
if (!mIsTransposed) {
|
||||
mContinuousTouchCount++;
|
||||
}
|
||||
if (mStartState == NORMAL && targetState == OVERVIEW) {
|
||||
if (mStartState == NORMAL && targetState == HINT_STATE_TWO_BUTTON) {
|
||||
SystemUiProxy.INSTANCE.get(mLauncher).onOverviewShown(true, TAG);
|
||||
} else if (targetState == NORMAL
|
||||
&& mContinuousTouchCount >= MAX_NUM_SWIPES_TO_TRIGGER_EDU) {
|
||||
|
||||
@@ -29,6 +29,7 @@ import androidx.annotation.NonNull;
|
||||
import com.android.launcher3.BaseQuickstepLauncher;
|
||||
import com.android.launcher3.LauncherState;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.states.StateAnimationConfig;
|
||||
import com.android.launcher3.views.FloatingIconView;
|
||||
import com.android.quickstep.util.RectFSpringAnim;
|
||||
import com.android.quickstep.util.StaggeredWorkspaceAnim;
|
||||
@@ -134,7 +135,7 @@ public class LauncherSwipeHandlerV2 extends
|
||||
// to home.
|
||||
long accuracy = 2 * Math.max(mDp.widthPx, mDp.heightPx);
|
||||
return mActivity.getStateManager().createAnimationToNewWorkspace(
|
||||
NORMAL, accuracy, 0 /* animComponents */);
|
||||
NORMAL, accuracy, StateAnimationConfig.SKIP_ALL_ANIMATIONS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -20,8 +20,6 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_MO
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVERVIEW_PEEK;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVERVIEW_SCALE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||
import static com.android.quickstep.views.RecentsView.ADJACENT_PAGE_OFFSET;
|
||||
import static com.android.quickstep.views.RecentsView.FULLSCREEN_PROGRESS;
|
||||
@@ -63,10 +61,6 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
|
||||
@Override
|
||||
public void setStateWithAnimation(RecentsState toState, StateAnimationConfig config,
|
||||
PendingAnimation setter) {
|
||||
if (!config.hasAnimationFlag(PLAY_ATOMIC_OVERVIEW_PEEK | PLAY_ATOMIC_OVERVIEW_SCALE)) {
|
||||
// The entire recents animation is played atomically.
|
||||
return;
|
||||
}
|
||||
if (config.hasAnimationFlag(SKIP_OVERVIEW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -22,13 +22,11 @@ import static com.android.launcher3.anim.Interpolators.FAST_OUT_SLOW_IN;
|
||||
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
|
||||
import static com.android.launcher3.anim.Interpolators.INSTANT;
|
||||
import static com.android.launcher3.anim.Interpolators.clampToProgress;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_COMPONENTS;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_ACTIONS_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_FADE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_SCALE;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_X;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_OVERVIEW_TRANSLATE_Y;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.PLAY_ATOMIC_OVERVIEW_PEEK;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.animation.AnimatorSet;
|
||||
@@ -105,10 +103,6 @@ public class OverviewToHomeAnim {
|
||||
|
||||
StateAnimationConfig config = new UseFirstInterpolatorStateAnimConfig();
|
||||
config.duration = duration;
|
||||
config.animFlags = playStaggeredWorkspaceAnim
|
||||
// StaggeredWorkspaceAnim doesn't animate overview, so we handle it here.
|
||||
? PLAY_ATOMIC_OVERVIEW_PEEK
|
||||
: ANIM_ALL_COMPONENTS;
|
||||
boolean isLayoutNaturalToLauncher = recentsView.getPagedOrientationHandler()
|
||||
.isLayoutNaturalToLauncher();
|
||||
config.setInterpolator(ANIM_OVERVIEW_TRANSLATE_X, isLayoutNaturalToLauncher
|
||||
|
||||
@@ -21,7 +21,6 @@ import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.anim.Interpolators.ACCEL_DEACCEL;
|
||||
import static com.android.launcher3.anim.Interpolators.LINEAR;
|
||||
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_ALL_COMPONENTS;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER;
|
||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||
|
||||
@@ -184,7 +183,7 @@ public class StaggeredWorkspaceAnim {
|
||||
*/
|
||||
private void prepareToAnimate(Launcher launcher, boolean animateOverviewScrim) {
|
||||
StateAnimationConfig config = new StateAnimationConfig();
|
||||
config.animFlags = ANIM_ALL_COMPONENTS | SKIP_OVERVIEW | SKIP_DEPTH_CONTROLLER;
|
||||
config.animFlags = SKIP_OVERVIEW | SKIP_DEPTH_CONTROLLER;
|
||||
config.duration = 0;
|
||||
// setRecentsAttachedToAppWindow() will animate recents out.
|
||||
launcher.getStateManager().createAtomicAnimation(BACKGROUND_APP, NORMAL, config).start();
|
||||
|
||||
Reference in new issue
Block a user