summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/anim/SpringAnimationHandler.java
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-08-23 13:19:24 -0700
committerJon Miranda <jonmiranda@google.com>2017-08-23 14:04:31 -0700
commitc90a89d9979829436a6baaf73d21b15d95e86eca (patch)
treee3c2901b4b45e6f20f5181e446a44a5a4c66bf41 /src/com/android/launcher3/anim/SpringAnimationHandler.java
parent86ba394ad0792d31dc9b4400ea362942413251f3 (diff)
downloadandroid_packages_apps_Trebuchet-c90a89d9979829436a6baaf73d21b15d95e86eca.tar.gz
android_packages_apps_Trebuchet-c90a89d9979829436a6baaf73d21b15d95e86eca.tar.bz2
android_packages_apps_Trebuchet-c90a89d9979829436a6baaf73d21b15d95e86eca.zip
Add spring to QSB when opening all apps.
Bug: 64355491 Change-Id: I760856a32779b314c8b01ef2c051985e18b68ecb
Diffstat (limited to 'src/com/android/launcher3/anim/SpringAnimationHandler.java')
-rw-r--r--src/com/android/launcher3/anim/SpringAnimationHandler.java27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/com/android/launcher3/anim/SpringAnimationHandler.java b/src/com/android/launcher3/anim/SpringAnimationHandler.java
index 3e58adc3f..eec3a48ee 100644
--- a/src/com/android/launcher3/anim/SpringAnimationHandler.java
+++ b/src/com/android/launcher3/anim/SpringAnimationHandler.java
@@ -70,6 +70,20 @@ public class SpringAnimationHandler<T> {
}
/**
+ * Adds a spring to the list of springs handled by this class.
+ * @param spring The new spring to be added.
+ * @param setDefaultValues If True, sets the spring to the default
+ * {@link AnimationFactory} values.
+ */
+ public void add(SpringAnimation spring, boolean setDefaultValues) {
+ if (setDefaultValues) {
+ mAnimationFactory.setDefaultValues(spring);
+ }
+ spring.setStartVelocity(mCurrentVelocity);
+ mAnimations.add(spring);
+ }
+
+ /**
* Adds a new or recycled animation to the list of springs handled by this class.
*
* @param view The view the spring is attached to.
@@ -82,15 +96,17 @@ public class SpringAnimationHandler<T> {
view.setTag(R.id.spring_animation_tag, spring);
}
mAnimationFactory.update(spring, object);
- spring.setStartVelocity(mCurrentVelocity);
- mAnimations.add(spring);
+ add(spring, false /* setDefaultValues */);
}
/**
* Stops and removes the spring attached to {@param view}.
*/
public void remove(View view) {
- SpringAnimation animation = (SpringAnimation) view.getTag(R.id.spring_animation_tag);
+ remove((SpringAnimation) view.getTag(R.id.spring_animation_tag));
+ }
+
+ public void remove(SpringAnimation animation) {
if (animation.canSkipToEnd()) {
animation.skipToEnd();
}
@@ -226,6 +242,11 @@ public class SpringAnimationHandler<T> {
* Updates the value of {@param spring} based on {@param object}.
*/
void update(SpringAnimation spring, T object);
+
+ /**
+ * Sets the factory default values for the given {@param spring}.
+ */
+ void setDefaultValues(SpringAnimation spring);
}
/**