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

Commit f8273b94 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix QSB animating separately from workspace during stagger anim" into ub-launcher3-rvc-dev

parents 065c84cb 5d4e8541
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ import android.animation.ValueAnimator;
import android.view.View;
import android.view.ViewGroup;

import com.android.launcher3.BaseQuickstepLauncher;
import com.android.launcher3.CellLayout;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.Launcher;
@@ -42,6 +43,7 @@ import com.android.launcher3.Workspace;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.SpringAnimationBuilder;
import com.android.launcher3.graphics.OverviewScrim;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.util.DynamicResource;
import com.android.quickstep.views.RecentsView;
@@ -128,6 +130,8 @@ public class StaggeredWorkspaceAnim {
            addScrimAnimationForState(launcher, NORMAL, ALPHA_DURATION_MS);
        }

        addDepthAnimationForState(launcher, NORMAL, ALPHA_DURATION_MS);

        mAnimators.play(launcher.getDragLayer().getScrim().createSysuiMultiplierAnim(0f, 1f)
                .setDuration(ALPHA_DURATION_MS));
        mAnimators.addListener(new AnimatorListenerAdapter() {
@@ -221,4 +225,14 @@ public class StaggeredWorkspaceAnim {
                ACCEL_DEACCEL);
        mAnimators.play(builder.buildAnim());
    }

    private void addDepthAnimationForState(Launcher launcher, LauncherState state, long duration) {
        if (!(launcher instanceof BaseQuickstepLauncher)) {
            return;
        }
        PendingAnimation builder = new PendingAnimation(duration);
        DepthController depthController = ((BaseQuickstepLauncher) launcher).getDepthController();
        depthController.setStateWithAnimation(state, new StateAnimationConfig(), builder);
        mAnimators.play(builder.buildAnim());
    }
}
+4 −2
Original line number Diff line number Diff line
@@ -306,9 +306,11 @@ public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>> {
                    + state);
        }
        PendingAnimation builder = new PendingAnimation(mConfig.duration);
        if (mConfig.getAnimComponents() != 0) {
            for (StateHandler handler : getStateHandlers()) {
                handler.setStateWithAnimation(state, mConfig, builder);
            }
        }
        builder.addListener(new AnimationSuccessListener() {

            @Override