Search in sources :

Example 56 with FastOutSlowInInterpolator

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();
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator) AnimatorSet(android.animation.AnimatorSet)

Example 57 with FastOutSlowInInterpolator

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;
    }
}
Also used : FastOutSlowInInterpolator(android.support.v4.view.animation.FastOutSlowInInterpolator)

Aggregations

FastOutSlowInInterpolator (android.support.v4.view.animation.FastOutSlowInInterpolator)53 Animator (android.animation.Animator)20 ValueAnimator (android.animation.ValueAnimator)17 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)16 View (android.view.View)14 ObjectAnimator (android.animation.ObjectAnimator)11 AnimatorSet (android.animation.AnimatorSet)9 BindView (butterknife.BindView)8 RecyclerView (android.support.v7.widget.RecyclerView)5 TextView (android.widget.TextView)5 MaterialTapTargetPrompt (uk.co.samuelwall.materialtaptargetprompt.MaterialTapTargetPrompt)5 ViewPropertyAnimatorListener (android.support.v4.view.ViewPropertyAnimatorListener)4 LinearOutSlowInInterpolator (android.support.v4.view.animation.LinearOutSlowInInterpolator)4 ExitFragmentTransition (com.kogitune.activity_transition.fragment.ExitFragmentTransition)3 ValueAnimator (com.nineoldandroids.animation.ValueAnimator)3 ArgbEvaluator (android.animation.ArgbEvaluator)2 TargetApi (android.annotation.TargetApi)2 Rect (android.graphics.Rect)2 Handler (android.os.Handler)2 FastOutLinearInInterpolator (android.support.v4.view.animation.FastOutLinearInInterpolator)2