Search in sources :

Example 6 with FastOutLinearInInterpolator

use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Douya by DreaminginCodeZH.

the class FriendlyFloatingActionButton method hide.

public void hide() {
    if (!mShowing) {
        return;
    }
    mShowing = false;
    cancelAnimator();
    mAnimator = ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), getHideTranslationY()).setDuration(mAnimationDuration);
    mAnimator.setInterpolator(new FastOutLinearInInterpolator());
    mAnimator.start();
}
Also used : FastOutLinearInInterpolator(androidx.interpolator.view.animation.FastOutLinearInInterpolator)

Example 7 with FastOutLinearInInterpolator

use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Douya by DreaminginCodeZH.

the class AppBarWrapperLayout method hide.

public void hide() {
    if (!mShowing) {
        return;
    }
    mShowing = false;
    cancelAnimator();
    mAnimator = new AnimatorSet().setDuration(mAnimationDuration);
    mAnimator.setInterpolator(new FastOutLinearInInterpolator());
    AnimatorSet.Builder builder = mAnimator.play(ObjectAnimator.ofFloat(this, TRANSLATION_Y, getTranslationY(), getHideTranslationY()));
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
        builder.before(ObjectAnimator.ofFloat(mShadowCompatView, ALPHA, mShadowCompatView.getAlpha(), 0));
    } else {
        builder.before(ObjectAnimator.ofFloat(mAppbarView, TRANSLATION_Z, mAppbarView.getTranslationZ(), -mAppbarView.getElevation()));
    }
    startAnimator();
}
Also used : FastOutLinearInInterpolator(androidx.interpolator.view.animation.FastOutLinearInInterpolator) AnimatorSet(android.animation.AnimatorSet)

Example 8 with FastOutLinearInInterpolator

use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Carbon by ZieIony.

the class AnimUtils method getProgressWidthOutAnimator.

public static Animator getProgressWidthOutAnimator() {
    ViewAnimator animator = new ViewAnimator();
    animator.setInterpolator(new FastOutLinearInInterpolator());
    animator.setOnSetupValuesListener(() -> {
        ProgressView circularProgress = (ProgressView) animator.getTarget();
        float start = circularProgress.getBarWidth();
        animator.setFloatValues(start, 0);
        animator.setDuration((long) (100 * start));
    });
    animator.addUpdateListener(valueAnimator -> {
        ProgressView circularProgress = (ProgressView) animator.getTarget();
        final float arcWidth = circularProgress.getBarPadding() + circularProgress.getBarWidth();
        float value = (Float) valueAnimator.getAnimatedValue();
        circularProgress.setBarWidth(value);
        circularProgress.setBarPadding(arcWidth - value);
    });
    return animator;
}
Also used : ProgressView(carbon.widget.ProgressView) FastOutLinearInInterpolator(androidx.interpolator.view.animation.FastOutLinearInInterpolator)

Example 9 with FastOutLinearInInterpolator

use of androidx.interpolator.view.animation.FastOutLinearInInterpolator in project Transitions-Everywhere by andkulikov.

the class ScaleSample method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_scale, container, false);
    final ViewGroup transitionsContainer = view.findViewById(R.id.transitions_container);
    final TextView text1 = transitionsContainer.findViewById(R.id.text1);
    transitionsContainer.findViewById(R.id.button1).setOnClickListener(new VisibleToggleClickListener() {

        @Override
        protected void changeVisibility(boolean visible) {
            TransitionManager.beginDelayedTransition(transitionsContainer, new Scale());
            text1.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
        }
    });
    final TextView text2 = transitionsContainer.findViewById(R.id.text2);
    transitionsContainer.findViewById(R.id.button2).setOnClickListener(new VisibleToggleClickListener() {

        @Override
        protected void changeVisibility(boolean visible) {
            TransitionSet set = new TransitionSet().addTransition(new Scale(0.7f)).addTransition(new Fade()).setInterpolator(visible ? new LinearOutSlowInInterpolator() : new FastOutLinearInInterpolator());
            TransitionManager.beginDelayedTransition(transitionsContainer, set);
            text2.setVisibility(visible ? View.VISIBLE : View.INVISIBLE);
        }
    });
    return view;
}
Also used : LinearOutSlowInInterpolator(androidx.interpolator.view.animation.LinearOutSlowInInterpolator) TransitionSet(androidx.transition.TransitionSet) ViewGroup(android.view.ViewGroup) FastOutLinearInInterpolator(androidx.interpolator.view.animation.FastOutLinearInInterpolator) TextView(android.widget.TextView) Scale(com.transitionseverywhere.extra.Scale) TextView(android.widget.TextView) View(android.view.View) Fade(androidx.transition.Fade) Nullable(androidx.annotation.Nullable)

Aggregations

FastOutLinearInInterpolator (androidx.interpolator.view.animation.FastOutLinearInInterpolator)9 View (android.view.View)4 ProgressView (carbon.widget.ProgressView)3 Animator (android.animation.Animator)2 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)2 ViewGroup (android.view.ViewGroup)2 ImageView (android.widget.ImageView)2 ShadowView (carbon.view.ShadowView)2 AnimatorSet (android.animation.AnimatorSet)1 ObjectAnimator (android.animation.ObjectAnimator)1 Animation (android.view.animation.Animation)1 TextView (android.widget.TextView)1 NonNull (androidx.annotation.NonNull)1 Nullable (androidx.annotation.Nullable)1 LinearOutSlowInInterpolator (androidx.interpolator.view.animation.LinearOutSlowInInterpolator)1 Fade (androidx.transition.Fade)1 TransitionSet (androidx.transition.TransitionSet)1 Scale (com.transitionseverywhere.extra.Scale)1