Merge "Fix regression where StaggeredWorkspaceAnim didn't respect animateScrim" into sc-dev am: c874ccc163
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14189989 Change-Id: Idef2d9ed9701917ad6994b345ba3073cc146ba36
This commit is contained in:
@@ -22,6 +22,7 @@ import static com.android.launcher3.anim.Interpolators.LINEAR;
|
|||||||
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
|
import static com.android.launcher3.anim.PropertySetter.NO_ANIM_PROPERTY_SETTER;
|
||||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER;
|
import static com.android.launcher3.states.StateAnimationConfig.SKIP_DEPTH_CONTROLLER;
|
||||||
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
import static com.android.launcher3.states.StateAnimationConfig.SKIP_OVERVIEW;
|
||||||
|
import static com.android.launcher3.states.StateAnimationConfig.SKIP_SCRIM;
|
||||||
|
|
||||||
import android.animation.Animator;
|
import android.animation.Animator;
|
||||||
import android.animation.AnimatorListenerAdapter;
|
import android.animation.AnimatorListenerAdapter;
|
||||||
@@ -181,7 +182,7 @@ public class StaggeredWorkspaceAnim {
|
|||||||
*/
|
*/
|
||||||
private void prepareToAnimate(Launcher launcher, boolean animateOverviewScrim) {
|
private void prepareToAnimate(Launcher launcher, boolean animateOverviewScrim) {
|
||||||
StateAnimationConfig config = new StateAnimationConfig();
|
StateAnimationConfig config = new StateAnimationConfig();
|
||||||
config.animFlags = SKIP_OVERVIEW | SKIP_DEPTH_CONTROLLER;
|
config.animFlags = SKIP_OVERVIEW | SKIP_DEPTH_CONTROLLER | SKIP_SCRIM;
|
||||||
config.duration = 0;
|
config.duration = 0;
|
||||||
// setRecentsAttachedToAppWindow() will animate recents out.
|
// setRecentsAttachedToAppWindow() will animate recents out.
|
||||||
launcher.getStateManager().createAtomicAnimation(BACKGROUND_APP, NORMAL, config).start();
|
launcher.getStateManager().createAtomicAnimation(BACKGROUND_APP, NORMAL, config).start();
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_F
|
|||||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_SCALE;
|
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_SCRIM_FADE;
|
||||||
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
|
import static com.android.launcher3.states.StateAnimationConfig.ANIM_WORKSPACE_TRANSLATE;
|
||||||
|
import static com.android.launcher3.states.StateAnimationConfig.SKIP_SCRIM;
|
||||||
|
|
||||||
import android.animation.ValueAnimator;
|
import android.animation.ValueAnimator;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@@ -151,7 +152,9 @@ public class WorkspaceStateTransitionAnimation {
|
|||||||
propertySetter.setFloat(mWorkspace.getPageIndicator(), VIEW_TRANSLATE_Y,
|
propertySetter.setFloat(mWorkspace.getPageIndicator(), VIEW_TRANSLATE_Y,
|
||||||
hotseatScaleAndTranslation.translationY, hotseatTranslationInterpolator);
|
hotseatScaleAndTranslation.translationY, hotseatTranslationInterpolator);
|
||||||
|
|
||||||
setScrim(propertySetter, state, config);
|
if (!config.hasAnimationFlag(SKIP_SCRIM)) {
|
||||||
|
setScrim(propertySetter, state, config);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -31,12 +31,14 @@ public class StateAnimationConfig {
|
|||||||
SKIP_ALL_ANIMATIONS,
|
SKIP_ALL_ANIMATIONS,
|
||||||
SKIP_OVERVIEW,
|
SKIP_OVERVIEW,
|
||||||
SKIP_DEPTH_CONTROLLER,
|
SKIP_DEPTH_CONTROLLER,
|
||||||
|
SKIP_SCRIM,
|
||||||
})
|
})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
public @interface AnimationFlags {}
|
public @interface AnimationFlags {}
|
||||||
public static final int SKIP_ALL_ANIMATIONS = 1 << 0;
|
public static final int SKIP_ALL_ANIMATIONS = 1 << 0;
|
||||||
public static final int SKIP_OVERVIEW = 1 << 1;
|
public static final int SKIP_OVERVIEW = 1 << 1;
|
||||||
public static final int SKIP_DEPTH_CONTROLLER = 1 << 2;
|
public static final int SKIP_DEPTH_CONTROLLER = 1 << 2;
|
||||||
|
public static final int SKIP_SCRIM = 1 << 3;
|
||||||
|
|
||||||
public long duration;
|
public long duration;
|
||||||
public boolean userControlled;
|
public boolean userControlled;
|
||||||
|
|||||||
Reference in New Issue
Block a user