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

Commit 3ab273da authored by Samuel Fufa's avatar Samuel Fufa Committed by Tony Wickham
Browse files

[Search][Motion] Modify interpolator for AllApps background scrim

Also rename ANIM_WORKSPACE_SCRIM_FADE to ANIM_SCRIM_FADE since
the scrim is shared between states now.

Bug: 183001675
Test: Manual in 3 button and 0 button modes
Change-Id: Ice83b54480bdf74155e8593c421b68d7186cf78a
parent 154b1c92
Loading
Loading
Loading
Loading
+22 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ 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.states.StateAnimationConfig.ANIM_ALL_APPS_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;

import android.view.MotionEvent;

@@ -56,7 +57,17 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
    /**
     * Minimum clamping progress for fading in all apps content
     */
    protected static final float ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD = 0.4f;
    protected static final float ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD = 0.5f;

    /**
     * Minimum clamping progress for fading in all apps scrim
     */
    protected static final float ALL_APPS_SCRIM_VISIBLE_THRESHOLD = .1f;

    /**
     * Maximum clamping progress for opaque all apps scrim
     */
    protected static final float ALL_APPS_SCRIM_OPAQUE_THRESHOLD = .5f;

    private final PortraitOverviewStateTouchHelper mOverviewPortraitStateTouchHelper;

@@ -116,14 +127,22 @@ public class PortraitStatesTouchController extends AbstractStateChangeTouchContr
    private StateAnimationConfig getNormalToAllAppsAnimation() {
        StateAnimationConfig builder = new StateAnimationConfig();
        builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(ACCEL,
                0, ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD));
                ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD,
                ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD));
        builder.setInterpolator(ANIM_SCRIM_FADE, Interpolators.clampToProgress(ACCEL,
                ALL_APPS_SCRIM_VISIBLE_THRESHOLD,
                ALL_APPS_SCRIM_OPAQUE_THRESHOLD));
        return builder;
    }

    private StateAnimationConfig getAllAppsToNormalAnimation() {
        StateAnimationConfig builder = new StateAnimationConfig();
        builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(DEACCEL,
                1 - ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD, 1));
                1 - ALL_APPS_CONTENT_FADE_MAX_CLAMPING_THRESHOLD,
                1 - ALL_APPS_CONTENT_FADE_MIN_CLAMPING_THRESHOLD));
        builder.setInterpolator(ANIM_SCRIM_FADE, Interpolators.clampToProgress(DEACCEL,
                1 - ALL_APPS_SCRIM_OPAQUE_THRESHOLD,
                1 - ALL_APPS_SCRIM_VISIBLE_THRESHOLD));
        return builder;
    }

+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ 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.ANIM_WORKSPACE_SCRIM_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
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;
@@ -98,6 +98,6 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState
                state.displayOverviewTasksAsGrid(mActivity.getDeviceProfile()) ? 1f : 0f, LINEAR);

        setter.setViewBackgroundColor(mActivity.getScrimView(), state.getScrimColor(mActivity),
                config.getInterpolator(ANIM_WORKSPACE_SCRIM_FADE, LINEAR));
                config.getInterpolator(ANIM_SCRIM_FADE, LINEAR));
    }
}
+2 −3
Original line number Diff line number Diff line
@@ -34,9 +34,9 @@ import static com.android.launcher3.graphics.Scrim.SCRIM_PROGRESS;
import static com.android.launcher3.graphics.SysUiScrim.SYSUI_PROGRESS;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_SCALE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_HOTSEAT_TRANSLATE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_SCRIM_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_SCALE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_SCRIM_FADE;
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
import static com.android.launcher3.states.StateAnimationConfig.SKIP_SCRIM;

@@ -166,10 +166,9 @@ public class WorkspaceStateTransitionAnimation {
        propertySetter.setFloat(sysUiScrim, SYSUI_PROGRESS,
                state.hasFlag(FLAG_HAS_SYS_UI_SCRIM) ? 1 : 0, LINEAR);


        propertySetter.setViewBackgroundColor(mLauncher.getScrimView(),
                state.getWorkspaceScrimColor(mLauncher),
                config.getInterpolator(ANIM_WORKSPACE_SCRIM_FADE, LINEAR));
                config.getInterpolator(ANIM_SCRIM_FADE, LINEAR));
    }

    public void applyChildState(LauncherState state, CellLayout cl, int childIndex) {
+2 −2
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ public class StateAnimationConfig {
            ANIM_OVERVIEW_TRANSLATE_Y,
            ANIM_OVERVIEW_FADE,
            ANIM_ALL_APPS_FADE,
            ANIM_WORKSPACE_SCRIM_FADE,
            ANIM_SCRIM_FADE,
            ANIM_OVERVIEW_MODAL,
            ANIM_DEPTH,
            ANIM_OVERVIEW_ACTIONS_FADE,
@@ -76,7 +76,7 @@ public class StateAnimationConfig {
    public static final int ANIM_OVERVIEW_TRANSLATE_Y = 8;
    public static final int ANIM_OVERVIEW_FADE = 9;
    public static final int ANIM_ALL_APPS_FADE = 10;
    public static final int ANIM_WORKSPACE_SCRIM_FADE = 11;
    public static final int ANIM_SCRIM_FADE = 11;
    public static final int ANIM_OVERVIEW_MODAL = 12;
    public static final int ANIM_DEPTH = 13;
    public static final int ANIM_OVERVIEW_ACTIONS_FADE = 14;