summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/states/StateAnimationConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/states/StateAnimationConfig.java')
-rw-r--r--src/com/android/launcher3/states/StateAnimationConfig.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/com/android/launcher3/states/StateAnimationConfig.java b/src/com/android/launcher3/states/StateAnimationConfig.java
index 0d9e01035e..0ca5afd1e8 100644
--- a/src/com/android/launcher3/states/StateAnimationConfig.java
+++ b/src/com/android/launcher3/states/StateAnimationConfig.java
@@ -40,8 +40,19 @@ public class StateAnimationConfig {
public static final int SKIP_DEPTH_CONTROLLER = 1 << 2;
public static final int SKIP_SCRIM = 1 << 3;
+ @IntDef(flag = true, value = {
+ USER_CONTROLLED,
+ HANDLE_STATE_APPLY
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface AnimationPropertyFlags {}
+ // Indicates that the animation is controlled by the user
+ public static final int USER_CONTROLLED = 1 << 0;
+ // Indicates that he animation can survive state UI resets due to inset or config changes
+ public static final int HANDLE_STATE_APPLY = 1 << 1;
+
public long duration;
- public boolean userControlled;
+ public @AnimationPropertyFlags int animProps = 0;
public @AnimationFlags int animFlags = 0;
@@ -105,12 +116,16 @@ public class StateAnimationConfig {
public void copyTo(StateAnimationConfig target) {
target.duration = duration;
target.animFlags = animFlags;
- target.userControlled = userControlled;
+ target.animProps = animProps;
for (int i = 0; i < ANIM_TYPES_COUNT; i++) {
target.mInterpolators[i] = mInterpolators[i];
}
}
+ public boolean isUserControlled() {
+ return (animProps & USER_CONTROLLED) != 0;
+ }
+
/**
* Returns the interpolator set for animId or fallback if nothing is set
*