Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82b8aa56 authored by Vinit Nayak's avatar Vinit Nayak
Browse files

Rename LauncherState QUICK_SWITCH to QUICK_SWITCH_FROM_HOME

Test: compiles
Bug: 265734073
Change-Id: I38e23c62b1eeae6a26db9c388655a8ffceb025b6
parent 57659257
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ import java.util.StringJoiner;
            boolean committed = !hasAnyFlag(FLAG_TRANSITION_STATE_RUNNING);
            playStateTransitionAnim(animatorSet, duration, committed);

            if (committed && mLauncherState == LauncherState.QUICK_SWITCH) {
            if (committed && mLauncherState == LauncherState.QUICK_SWITCH_FROM_HOME) {
                // We're about to be paused, set immediately to ensure seamless handoff.
                updateStateForFlag(FLAG_RESUMED, false);
                applyState(0 /* duration */);
+3 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.launcher3.uioverrides;

import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.anim.Interpolators.AGGRESSIVE_EASE_IN_OUT;
import static com.android.launcher3.anim.Interpolators.FINAL_FRAME;
import static com.android.launcher3.anim.Interpolators.INSTANT;
@@ -167,12 +168,12 @@ public abstract class BaseRecentsViewStateController<T extends RecentsView>
        LauncherState fromState = mLauncher.getStateManager().getState();
        setter.setFloat(mRecentsView, TASK_THUMBNAIL_SPLASH_ALPHA,
                toState.showTaskThumbnailSplash() ? 1f : 0f,
                !toState.showTaskThumbnailSplash() && fromState == LauncherState.QUICK_SWITCH
                !toState.showTaskThumbnailSplash() && fromState == QUICK_SWITCH_FROM_HOME
                        ? LINEAR : INSTANT);

        boolean showAsGrid = toState.displayOverviewTasksAsGrid(mLauncher.getDeviceProfile());
        Interpolator gridProgressInterpolator = showAsGrid
                ? fromState == LauncherState.QUICK_SWITCH ? LINEAR : INSTANT
                ? fromState == QUICK_SWITCH_FROM_HOME ? LINEAR : INSTANT
                : FINAL_FRAME;
        setter.setFloat(mRecentsView, RECENTS_GRID_PROGRESS, showAsGrid ? 1f : 0f,
                gridProgressInterpolator);
+11 −11
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ import static com.android.launcher3.LauncherAnimUtils.newCancelListener;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS;
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.anim.Interpolators.ACCEL_0_75;
@@ -195,7 +195,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        nonOverviewBuilder.setInterpolator(ANIM_WORKSPACE_SCALE, FADE_OUT_INTERPOLATOR);
        nonOverviewBuilder.setInterpolator(ANIM_DEPTH, FADE_OUT_INTERPOLATOR);
        nonOverviewBuilder.setInterpolator(ANIM_VERTICAL_PROGRESS, TRANSLATE_OUT_INTERPOLATOR);
        updateNonOverviewAnim(QUICK_SWITCH, nonOverviewBuilder);
        updateNonOverviewAnim(QUICK_SWITCH_FROM_HOME, nonOverviewBuilder);
        mNonOverviewAnim.dispatchOnStart();

        if (mRecentsView.getTaskViewCount() == 0) {
@@ -220,7 +220,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
    }

    private void setupOverviewAnimators() {
        final LauncherState fromState = QUICK_SWITCH;
        final LauncherState fromState = QUICK_SWITCH_FROM_HOME;
        final LauncherState toState = OVERVIEW;

        // Set RecentView's initial properties.
@@ -243,7 +243,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
        // Use QuickSwitchState instead of OverviewState to determine scrim color,
        // since we need to take potential taskbar into account.
        xAnim.setViewBackgroundColor(mLauncher.getScrimView(),
                QUICK_SWITCH.getWorkspaceScrimColor(mLauncher), LINEAR);
                QUICK_SWITCH_FROM_HOME.getWorkspaceScrimColor(mLauncher), LINEAR);
        if (mRecentsView.getTaskViewCount() == 0) {
            xAnim.addFloat(mRecentsView, CONTENT_ALPHA, 0f, 1f, LINEAR);
        }
@@ -335,24 +335,24 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
            } else {
                if (velocity.y > 0) {
                    // Flinging right and down goes to quick switch.
                    targetState = QUICK_SWITCH;
                    targetState = QUICK_SWITCH_FROM_HOME;
                } else {
                    // Flinging up and right could go either home or to quick switch.
                    // Determine the target based on the higher velocity.
                    targetState = Math.abs(velocity.x) > Math.abs(velocity.y)
                        ? QUICK_SWITCH : NORMAL;
                        ? QUICK_SWITCH_FROM_HOME : NORMAL;
                }
            }
        } else if (horizontalFling) {
            targetState = velocity.x > 0 ? QUICK_SWITCH : NORMAL;
            targetState = velocity.x > 0 ? QUICK_SWITCH_FROM_HOME : NORMAL;
        } else if (verticalFling) {
            targetState = velocity.y > 0 ? QUICK_SWITCH : NORMAL;
            targetState = velocity.y > 0 ? QUICK_SWITCH_FROM_HOME : NORMAL;
        } else {
            // If user isn't flinging, just snap to the closest state.
            boolean passedHorizontalThreshold = mXOverviewAnim.getInterpolatedProgress() > 0.5f;
            boolean passedVerticalThreshold = mYOverviewAnim.value > 1f;
            targetState = passedHorizontalThreshold && !passedVerticalThreshold
                    ? QUICK_SWITCH : NORMAL;
                    ? QUICK_SWITCH_FROM_HOME : NORMAL;
        }

        // Animate the various components to the target state.
@@ -414,7 +414,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
            nonOverviewAnim.setFloatValues(startProgress, endProgress);
            mNonOverviewAnim.dispatchOnStart();
        }
        if (targetState == QUICK_SWITCH) {
        if (targetState == QUICK_SWITCH_FROM_HOME) {
            // Navigating to quick switch, add scroll feedback since the first time is not
            // considered a scroll by the RecentsView.
            VibratorWrapper.INSTANCE.get(mLauncher).vibrate(
@@ -437,7 +437,7 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
                .withSrcState(LAUNCHER_STATE_HOME)
                .withDstState(targetState.statsLogOrdinal)
                .log(getLauncherAtomEvent(mStartState.statsLogOrdinal, targetState.statsLogOrdinal,
                        targetState == QUICK_SWITCH
                        targetState == QUICK_SWITCH_FROM_HOME
                                ? LAUNCHER_QUICKSWITCH_RIGHT
                                : targetState.ordinal > mStartState.ordinal
                                        ? LAUNCHER_UNKNOWN_SWIPEUP
+3 −3
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@
package com.android.launcher3.uioverrides.touchcontrollers;

import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.anim.Interpolators.ACCEL_2;
import static com.android.launcher3.anim.Interpolators.DEACCEL_2;
import static com.android.launcher3.anim.Interpolators.INSTANT;
@@ -87,7 +87,7 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
        if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) {
            return NORMAL;
        }
        return isDragTowardPositive ? QUICK_SWITCH : NORMAL;
        return isDragTowardPositive ? QUICK_SWITCH_FROM_HOME : NORMAL;
    }

    @Override
@@ -110,7 +110,7 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll

        // Set RecentView's initial properties for coming in from the side.
        RECENTS_SCALE_PROPERTY.set(mOverviewPanel,
                QUICK_SWITCH.getOverviewScaleAndOffset(mLauncher)[0] * 0.85f);
                QUICK_SWITCH_FROM_HOME.getOverviewScaleAndOffset(mLauncher)[0] * 0.85f);
        ADJACENT_PAGE_HORIZONTAL_OFFSET.set(mOverviewPanel, 1f);
        mOverviewPanel.setContentAlpha(1);

+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package com.android.quickstep;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.QUICK_SWITCH;
import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
@@ -346,7 +346,7 @@ public final class LauncherActivityInterface extends
            case RECENTS:
                return OVERVIEW;
            case NEW_TASK:
                return QUICK_SWITCH;
                return QUICK_SWITCH_FROM_HOME;
            case LAST_TASK:
                return BACKGROUND_APP;
            case HOME:
Loading