Loading quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java +5 −0 Original line number Diff line number Diff line Loading @@ -85,4 +85,9 @@ public class AllAppsState extends LauncherState { public float getHoseatAlpha(Launcher launcher) { return launcher.getDeviceProfile().isVerticalBarLayout() ? 0 : 1; } @Override public LauncherState getHistoryForState(LauncherState previousState) { return previousState == OVERVIEW ? OVERVIEW : NORMAL; } } quickstep/src/com/android/launcher3/uioverrides/TwoStepSwipeController.java +8 −1 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter private static final int FLAG_RECENTS_PLAN_LOADING = 1 << 3; private static final int FLAG_OVERVIEW_DISABLED = 1 << 4; private static final int FLAG_DISABLED_TWO_TARGETS = 1 << 5; private static final int FLAG_DISABLED_BACK_TARGET = 1 << 6; private final Launcher mLauncher; private final SwipeDetector mDetector; Loading Loading @@ -261,6 +262,12 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter // Build current animation mFromState = mLauncher.getStateManager().getState(); mToState = mLauncher.isInState(ALL_APPS) ? NORMAL : ALL_APPS; if (mToState == NORMAL && mLauncher.getStateManager().getLastState() == OVERVIEW) { mToState = OVERVIEW; mDragPauseDetector.addDisabledFlags(FLAG_DISABLED_BACK_TARGET); } mTaggedAnimatorSetBuilder = new TaggedAnimatorSetBuilder(); mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace( mToState, mTaggedAnimatorSetBuilder, maxAccuracy); Loading Loading @@ -336,7 +343,7 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter if (fling) { logAction = Touch.FLING; targetState = velocity < 0 ? ALL_APPS : NORMAL; targetState = velocity < 0 ? ALL_APPS : mLauncher.getStateManager().getLastState(); // snap to top or bottom using the release velocity } else { logAction = Touch.SWIPE; Loading src/com/android/launcher3/Launcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -1608,8 +1608,9 @@ public class Launcher extends BaseActivity if (topView != null) { topView.onBackPressed(); } else if (!isInState(NORMAL)) { LauncherState lastState = mStateManager.getLastState(); ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType); mStateManager.goToState(NORMAL); mStateManager.goToState(lastState); } else { // Back button is a no-op here, but give at least some feedback for the button press mWorkspace.showOutlinesTemporarily(); Loading src/com/android/launcher3/LauncherState.java +5 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,11 @@ public class LauncherState { }; } public LauncherState getHistoryForState(LauncherState previousState) { // No history is supported return NORMAL; } protected static void dispatchWindowStateChanged(Launcher launcher) { launcher.getWindow().getDecorView().sendAccessibilityEvent(TYPE_WINDOW_STATE_CHANGED); } Loading src/com/android/launcher3/LauncherStateManager.java +14 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ import com.android.launcher3.uioverrides.UiFactory; * - Go back with back key TODO: make this not go to workspace * - From all apps * - From workspace * - Enter and exit car mode (becuase it causes an extra configuration changed) * - Enter and exit car mode (becase it causes an extra configuration changed) * - From all apps * - From the center workspace * - From another workspace Loading @@ -82,6 +82,9 @@ public class LauncherStateManager { private StateHandler[] mStateHandlers; private LauncherState mState = NORMAL; private LauncherState mLastStableState = NORMAL; private LauncherState mCurrentStableState = NORMAL; private StateListener mStateListener; public LauncherStateManager(Launcher l) { Loading Loading @@ -261,11 +264,21 @@ public class LauncherStateManager { } private void onStateTransitionEnd(LauncherState state) { // Only change the stable states after the transitions have finished if (state != mCurrentStableState) { mLastStableState = state.getHistoryForState(mCurrentStableState); mCurrentStableState = state; } mLauncher.getWorkspace().setClipChildren(!state.disablePageClipping); mLauncher.getUserEventDispatcher().resetElapsedContainerMillis(); mLauncher.finishAutoCancelActionMode(); } public LauncherState getLastState() { return mLastStableState; } /** * Cancels the current animation. */ Loading Loading
quickstep/src/com/android/launcher3/uioverrides/AllAppsState.java +5 −0 Original line number Diff line number Diff line Loading @@ -85,4 +85,9 @@ public class AllAppsState extends LauncherState { public float getHoseatAlpha(Launcher launcher) { return launcher.getDeviceProfile().isVerticalBarLayout() ? 0 : 1; } @Override public LauncherState getHistoryForState(LauncherState previousState) { return previousState == OVERVIEW ? OVERVIEW : NORMAL; } }
quickstep/src/com/android/launcher3/uioverrides/TwoStepSwipeController.java +8 −1 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter private static final int FLAG_RECENTS_PLAN_LOADING = 1 << 3; private static final int FLAG_OVERVIEW_DISABLED = 1 << 4; private static final int FLAG_DISABLED_TWO_TARGETS = 1 << 5; private static final int FLAG_DISABLED_BACK_TARGET = 1 << 6; private final Launcher mLauncher; private final SwipeDetector mDetector; Loading Loading @@ -261,6 +262,12 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter // Build current animation mFromState = mLauncher.getStateManager().getState(); mToState = mLauncher.isInState(ALL_APPS) ? NORMAL : ALL_APPS; if (mToState == NORMAL && mLauncher.getStateManager().getLastState() == OVERVIEW) { mToState = OVERVIEW; mDragPauseDetector.addDisabledFlags(FLAG_DISABLED_BACK_TARGET); } mTaggedAnimatorSetBuilder = new TaggedAnimatorSetBuilder(); mCurrentAnimation = mLauncher.getStateManager().createAnimationToNewWorkspace( mToState, mTaggedAnimatorSetBuilder, maxAccuracy); Loading Loading @@ -336,7 +343,7 @@ public class TwoStepSwipeController extends AnimatorListenerAdapter if (fling) { logAction = Touch.FLING; targetState = velocity < 0 ? ALL_APPS : NORMAL; targetState = velocity < 0 ? ALL_APPS : mLauncher.getStateManager().getLastState(); // snap to top or bottom using the release velocity } else { logAction = Touch.SWIPE; Loading
src/com/android/launcher3/Launcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -1608,8 +1608,9 @@ public class Launcher extends BaseActivity if (topView != null) { topView.onBackPressed(); } else if (!isInState(NORMAL)) { LauncherState lastState = mStateManager.getLastState(); ued.logActionCommand(Action.Command.BACK, mStateManager.getState().containerType); mStateManager.goToState(NORMAL); mStateManager.goToState(lastState); } else { // Back button is a no-op here, but give at least some feedback for the button press mWorkspace.showOutlinesTemporarily(); Loading
src/com/android/launcher3/LauncherState.java +5 −0 Original line number Diff line number Diff line Loading @@ -170,6 +170,11 @@ public class LauncherState { }; } public LauncherState getHistoryForState(LauncherState previousState) { // No history is supported return NORMAL; } protected static void dispatchWindowStateChanged(Launcher launcher) { launcher.getWindow().getDecorView().sendAccessibilityEvent(TYPE_WINDOW_STATE_CHANGED); } Loading
src/com/android/launcher3/LauncherStateManager.java +14 −1 Original line number Diff line number Diff line Loading @@ -66,7 +66,7 @@ import com.android.launcher3.uioverrides.UiFactory; * - Go back with back key TODO: make this not go to workspace * - From all apps * - From workspace * - Enter and exit car mode (becuase it causes an extra configuration changed) * - Enter and exit car mode (becase it causes an extra configuration changed) * - From all apps * - From the center workspace * - From another workspace Loading @@ -82,6 +82,9 @@ public class LauncherStateManager { private StateHandler[] mStateHandlers; private LauncherState mState = NORMAL; private LauncherState mLastStableState = NORMAL; private LauncherState mCurrentStableState = NORMAL; private StateListener mStateListener; public LauncherStateManager(Launcher l) { Loading Loading @@ -261,11 +264,21 @@ public class LauncherStateManager { } private void onStateTransitionEnd(LauncherState state) { // Only change the stable states after the transitions have finished if (state != mCurrentStableState) { mLastStableState = state.getHistoryForState(mCurrentStableState); mCurrentStableState = state; } mLauncher.getWorkspace().setClipChildren(!state.disablePageClipping); mLauncher.getUserEventDispatcher().resetElapsedContainerMillis(); mLauncher.finishAutoCancelActionMode(); } public LauncherState getLastState() { return mLastStableState; } /** * Cancels the current animation. */ Loading