use of android.support.v4.view.animation.FastOutSlowInInterpolator in project android_packages_apps_Dialer by LineageOS.
the class DotAnswerHint method onBounceStart.
@Override
public void onBounceStart() {
if (answerGestureHintAnim == null) {
answerGestureHintAnim = new AnimatorSet();
int[] puckLocation = new int[2];
puck.getLocationInWindow(puckLocation);
answerHintContainer.setY(puckLocation[1] + getDimension(R.dimen.hint_initial_offset));
Animator fadeIn = createFadeIn();
Animator swipeUp = ObjectAnimator.ofFloat(answerHintContainer, View.TRANSLATION_Y, puckLocation[1] - getDimension(R.dimen.hint_offset));
swipeUp.setInterpolator(new FastOutSlowInInterpolator());
swipeUp.setDuration(SWIPE_UP_DURATION_ALPHA_MILLIS);
Animator fadeOut = createFadeOut();
answerGestureHintAnim.play(fadeIn).after(puckUpDelayMillis);
answerGestureHintAnim.play(swipeUp).after(fadeIn);
// The fade out should start fading the alpha just as the puck is dropping. Scaling will start
// a bit earlier.
answerGestureHintAnim.play(fadeOut).after(puckUpDelayMillis + puckUpDurationMillis - FADE_OUT_DELAY_ALPHA_MILLIS);
fadeIn.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
answerHintSmall.setAlpha(0);
answerHintSmall.setScaleX(1);
answerHintSmall.setScaleY(1);
answerHintMid.setAlpha(0);
answerHintMid.setScaleX(1);
answerHintMid.setScaleY(1);
answerHintLarge.setAlpha(0);
answerHintLarge.setScaleX(1);
answerHintLarge.setScaleY(1);
answerHintContainer.setY(puckLocation[1] + getDimension(R.dimen.hint_initial_offset));
answerHintContainer.setVisibility(View.VISIBLE);
}
});
}
answerGestureHintAnim.start();
}
use of android.support.v4.view.animation.FastOutSlowInInterpolator in project FABsMenu by jahirfiquitiva.
the class FABSnackbarBehavior method updateFabTranslationForSnackbar.
/**
* Animate FAB on snackbar change.
*/
private void updateFabTranslationForSnackbar(CoordinatorLayout parent, View fab, View snackbar) {
final float translationY = getFabTranslationYForSnackbar(parent, fab);
if (translationY != this.mTranslationY) {
ViewCompat.animate(fab).cancel();
if (Math.abs(translationY - this.mTranslationY) == (float) snackbar.getHeight()) {
ViewCompat.animate(fab).translationY(translationY).setInterpolator(new FastOutSlowInInterpolator());
} else {
fab.setTranslationY(translationY);
}
this.mTranslationY = translationY;
}
}
Aggregations