Fix QSB animating separately from workspace during stagger anim
- Don't play any state animation if animComponents == 0 - StaggeredWorkspaceAnim handles depth controller Bug: 157596833 Change-Id: I6ae4c5da2e837c61b57349e708b7499af8e14aaa
This commit is contained in:
+14
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user