Add spring to QSB when opening all apps.

Bug: 64355491
Change-Id: I760856a32779b314c8b01ef2c051985e18b68ecb
This commit is contained in:
Jon Miranda
2017-08-23 13:19:24 -07:00
parent 86ba394ad0
commit c90a89d997
5 changed files with 63 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import android.animation.AnimatorSet;
import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.graphics.Color;
import android.support.animation.SpringAnimation;
import android.support.v4.graphics.ColorUtils;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
import android.view.MotionEvent;
@@ -101,6 +102,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
private AnimatorSet mDiscoBounceAnimation;
private GradientView mGradientView;
private SpringAnimation mSearchSpring;
private SpringAnimationHandler mSpringAnimationHandler;
public AllAppsTransitionController(Launcher l) {
@@ -226,6 +228,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
}
mLauncher.showAppsView(true /* animated */, false /* updatePredictedApps */);
if (hasSpringAnimationHandler()) {
mSpringAnimationHandler.add(mSearchSpring, true /* setDefaultValues */);
// The icons are moving upwards, so we go to 0 from 1. (y-axis 1 is below 0.)
mSpringAnimationHandler.animateToFinalPosition(0 /* pos */, 1 /* startValue */);
}
@@ -499,6 +502,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
public void finishPullUp() {
mHotseat.setVisibility(View.INVISIBLE);
if (hasSpringAnimationHandler()) {
mSpringAnimationHandler.remove(mSearchSpring);
mSpringAnimationHandler.reset();
}
setProgress(0f);
@@ -544,6 +548,7 @@ public class AllAppsTransitionController implements TouchController, SwipeDetect
mWorkspace.getPageIndicator().getCaretDrawable(), mLauncher);
mAppsView.getSearchUiManager().addOnScrollRangeChangeListener(this);
mSpringAnimationHandler = mAppsView.getSpringAnimationHandler();
mSearchSpring = mAppsView.getSearchUiManager().getSpringForFling();
}
private boolean hasSpringAnimationHandler() {