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

This commit is contained in:
TreeHugger Robot
2020-05-28 22:43:50 +00:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 2 deletions
@@ -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());
}
}
@@ -306,8 +306,10 @@ public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>> {
+ state);
}
PendingAnimation builder = new PendingAnimation(mConfig.duration);
for (StateHandler handler : getStateHandlers()) {
handler.setStateWithAnimation(state, mConfig, builder);
if (mConfig.getAnimComponents() != 0) {
for (StateHandler handler : getStateHandlers()) {
handler.setStateWithAnimation(state, mConfig, builder);
}
}
builder.addListener(new AnimationSuccessListener() {