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

Commit e9054e32 authored by Tony's avatar Tony Committed by Tony Wickham
Browse files

Remove quick switch and improve quick scrub

- Hide hotseat and center recents vertically during quick scrub
  - Don't animate the state change if launcher wasn't already visible, but still
    wait until the window animation completes before scrubbing past the next app
- Change interpolator of window as it scales offscreen during quick scrub, so that
  it gets out of the way faster and you can see the motion of the next app taking
  its place
- Remove haptic when snapping to task when quick scrub starts (there's already a
  haptic from the home button)

Bug: 70180755
Change-Id: I83f25bc8b791da0676c13fd62698e1f486dc016f
parent f6a8f955
Loading
Loading
Loading
Loading
−32 B (116 KiB)

File changed.

No diff preview for this file type.

+4 −2
Original line number Diff line number Diff line
@@ -88,8 +88,10 @@ public class AllAppsState extends LauncherState {
    }

    @Override
    public float getOverviewTranslationFactor(Launcher launcher) {
        return 0;
    public float[] getOverviewTranslationFactor(Launcher launcher) {
        // Keep the same translation as in overview, so that we don't slide around when
        // transitioning to All Apps.
        return LauncherState.OVERVIEW.getOverviewTranslationFactor(launcher);
    }

    @Override
+7 −7
Original line number Diff line number Diff line
@@ -28,10 +28,8 @@ public class FastOverviewState extends OverviewState {
    private static final int STATE_FLAGS = FLAG_SHOW_SCRIM | FLAG_DISABLE_RESTORE
            | FLAG_DISABLE_INTERACTION | FLAG_OVERVIEW_UI | FLAG_HIDE_BACK_BUTTON;

    private static final boolean DEBUG_DIFFERENT_UI = false;

    public FastOverviewState(int id) {
        super(id, QuickScrubController.QUICK_SWITCH_START_DURATION, STATE_FLAGS);
        super(id, QuickScrubController.QUICK_SCRUB_START_DURATION, STATE_FLAGS);
    }

    @Override
@@ -48,9 +46,11 @@ public class FastOverviewState extends OverviewState {

    @Override
    public int getVisibleElements(Launcher launcher) {
        if (DEBUG_DIFFERENT_UI) {
        return NONE;
    }
        return super.getVisibleElements(launcher);

    @Override
    public float[] getOverviewTranslationFactor(Launcher launcher) {
        return new float[] {0f, 0.5f};
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -58,8 +58,8 @@ public class OverviewState extends LauncherState {
    }

    @Override
    public float getOverviewTranslationFactor(Launcher launcher) {
        return 0;
    public float[] getOverviewTranslationFactor(Launcher launcher) {
        return new float[] {0f, 0f};
    }

    @Override
+11 −4
Original line number Diff line number Diff line
@@ -20,7 +20,8 @@ import static com.android.launcher3.anim.AlphaUpdateListener.updateVisibility;
import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_OVERVIEW_TRANSLATION;
import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.compat.AccessibilityManagerCompat.isAccessibilityEnabled;
import static com.android.quickstep.views.LauncherRecentsView.TRANSLATION_FACTOR;
import static com.android.quickstep.views.LauncherRecentsView.TRANSLATION_X_FACTOR;
import static com.android.quickstep.views.LauncherRecentsView.TRANSLATION_Y_FACTOR;

import android.animation.ValueAnimator;
import android.annotation.TargetApi;
@@ -50,7 +51,9 @@ public class RecentsViewStateController implements StateHandler {
    public void setState(LauncherState state) {
        mRecentsView.setAlpha(state.overviewUi ? 1 : 0);
        updateVisibility(mRecentsView, isAccessibilityEnabled(mLauncher));
        mRecentsView.setTranslationFactor(state.getOverviewTranslationFactor(mLauncher));
        float[] translationFactor = state.getOverviewTranslationFactor(mLauncher);
        mRecentsView.setTranslationXFactor(translationFactor[0]);
        mRecentsView.setTranslationYFactor(translationFactor[1]);
        if (state.overviewUi) {
            mRecentsView.resetTaskVisuals();
        }
@@ -73,8 +76,12 @@ public class RecentsViewStateController implements StateHandler {
        }

        PropertySetter setter = config.getProperSetter(builder);
        setter.setFloat(mRecentsView, TRANSLATION_FACTOR,
                toState.getOverviewTranslationFactor(mLauncher),
        float[] translationFactor = toState.getOverviewTranslationFactor(mLauncher);
        setter.setFloat(mRecentsView, TRANSLATION_X_FACTOR,
                translationFactor[0],
                builder.getInterpolator(ANIM_OVERVIEW_TRANSLATION, LINEAR));
        setter.setFloat(mRecentsView, TRANSLATION_Y_FACTOR,
                translationFactor[1],
                builder.getInterpolator(ANIM_OVERVIEW_TRANSLATION, LINEAR));
        setter.setViewAlpha(mRecentsView, toState.overviewUi ? 1 : 0, LINEAR);

Loading