summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2018-06-26 23:00:46 +0000
committerAndroid Build Merger (Role) <noreply-android-build-merger@google.com>2018-06-26 23:00:46 +0000
commitc30621cff94eb8471ed777e7970163a493f7a623 (patch)
tree3461cc97de5a59e26d0a78224cbef1ff35ead0b6
parentd3f6ec1de7049b20b9edfde1cc03606b3fc01718 (diff)
parent6a2a1a91a01b58af68b378612a4a33ca94d3363b (diff)
downloadandroid_packages_apps_Trebuchet-c30621cff94eb8471ed777e7970163a493f7a623.tar.gz
android_packages_apps_Trebuchet-c30621cff94eb8471ed777e7970163a493f7a623.tar.bz2
android_packages_apps_Trebuchet-c30621cff94eb8471ed777e7970163a493f7a623.zip
[automerger] Revert "Refactor "spring" code into one method." am: 6a2a1a91a0
Change-Id: I158aa43199f611917b2a2f24a05c0431c8017699
-rw-r--r--quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java62
1 files changed, 31 insertions, 31 deletions
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index 252e3eaee..4108cd290 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -57,7 +57,6 @@ import android.os.CancellationSignal;
import android.os.Handler;
import android.os.Looper;
import android.util.Pair;
-import android.util.Property;
import android.view.View;
import android.view.ViewGroup;
@@ -805,9 +804,25 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
float shiftRange = allAppsController.getShiftRange();
float slideStart = shiftRange / (shiftRange - mStartSlideTransY);
float oscillateStart = shiftRange / (shiftRange - mEndSlideTransY);
+ // Ensures a clean hand-off between slide and oscillate.
+ float slideEnd = Utilities.mapToRange(0, 0, 1f, oscillateStart, 1, OSCILLATE);
- buildSpringAnimation(workspaceAnimator, allAppsController, ALL_APPS_PROGRESS,
- 0 /* startDelay */, slideStart, oscillateStart, 1f /* finalPosition */);
+ allAppsController.setProgress(slideStart);
+ Animator slideIn = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS,
+ slideStart, slideEnd);
+ slideIn.setDuration(SPRING_SLIDE_DURATION);
+ slideIn.setInterpolator(DEACCEL);
+
+ Animator oscillate = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS,
+ oscillateStart, 1f);
+ oscillate.setDuration(SPRING_OSCILLATE_DURATION);
+ oscillate.setInterpolator(OSCILLATE);
+
+ Animator settle = ObjectAnimator.ofFloat(allAppsController, ALL_APPS_PROGRESS, 1f);
+ settle.setDuration(SPRING_SETTLE_DURATION);
+ settle.setInterpolator(LINEAR);
+
+ workspaceAnimator.playSequentially(slideIn, oscillate, settle);
}
mDragLayer.getScrim().hideSysUiScrim(true);
@@ -837,50 +852,35 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
v.setAlpha(0);
ObjectAnimator alpha = ObjectAnimator.ofFloat(v, View.ALPHA, 1f);
alpha.setInterpolator(LINEAR);
- alpha.setDuration(SPRING_SLIDE_DURATION + SPRING_OSCILLATE_DURATION);
+ alpha.setDuration(SPRING_SLIDE_DURATION);
alpha.setStartDelay(startDelay);
outAnimator.play(alpha);
- buildSpringAnimation(outAnimator, v, TRANSLATION_Y, startDelay, mStartSlideTransY,
- mEndSlideTransY, 0f /* finalPosition */);
-
- outAnimator.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- v.setAlpha(1f);
- v.setTranslationY(0);
- }
- });
- }
-
- /**
- * Spring animations consists of three sequential animators: a slide, an oscillation, and
- * a settle.
- */
- private <T> void buildSpringAnimation(AnimatorSet outAnimator, T objectToSpring,
- Property<T, Float> property, long startDelay, float slideStart, float oscillateStart,
- float finalPosition) {
// Ensures a clean hand-off between slide and oscillate.
- float slideEnd = Utilities.mapToRange(0, 0, 1f, oscillateStart, finalPosition, OSCILLATE);
-
- property.set(objectToSpring, slideStart);
-
- ObjectAnimator slideIn = ObjectAnimator.ofFloat(objectToSpring, property, slideStart,
+ float slideEnd = Utilities.mapToRange(0, 0, 1f, mEndSlideTransY, 0, OSCILLATE);
+ v.setTranslationY(mStartSlideTransY);
+ ObjectAnimator slideIn = ObjectAnimator.ofFloat(v, TRANSLATION_Y, mStartSlideTransY,
slideEnd);
slideIn.setInterpolator(DEACCEL);
slideIn.setStartDelay(startDelay);
slideIn.setDuration(SPRING_SLIDE_DURATION);
- ObjectAnimator oscillate = ObjectAnimator.ofFloat(objectToSpring, property, oscillateStart,
- finalPosition);
+ ObjectAnimator oscillate = ObjectAnimator.ofFloat(v, TRANSLATION_Y, mEndSlideTransY, 0);
oscillate.setInterpolator(OSCILLATE);
oscillate.setDuration(SPRING_OSCILLATE_DURATION);
- ObjectAnimator settle = ObjectAnimator.ofFloat(objectToSpring, property, finalPosition);
+ ObjectAnimator settle = ObjectAnimator.ofFloat(v, TRANSLATION_Y, 0);
settle.setInterpolator(LINEAR);
settle.setDuration(SPRING_SETTLE_DURATION);
outAnimator.playSequentially(slideIn, oscillate, settle);
+ outAnimator.addListener(new AnimatorListenerAdapter() {
+ @Override
+ public void onAnimationEnd(Animator animation) {
+ v.setAlpha(1f);
+ v.setTranslationY(0);
+ }
+ });
}
private void resetContentView() {