Search in sources :

Example 26 with FastOutSlowInInterpolator

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

the class SearchToolbarActivity method closeSearch.

private void closeSearch() {
    int[] setLocation = new int[2];
    searchBar.getLocationOnScreen(setLocation);
    int[] sbLocation = new int[2];
    closeButton.getLocationOnScreen(sbLocation);
    Animator animator = searchBar.createCircularReveal(sbLocation[0] - setLocation[0] + closeButton.getWidth() / 2, searchBar.getHeight() / 2, searchBar.getWidth(), 0);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            searchBar.setVisibility(View.INVISIBLE);
        }
    });
    animator.start();
    searchEditText.clearFocus();
}
Also used : Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator)

Example 27 with FastOutSlowInInterpolator

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

the class SearchToolbarActivity method openSearch.

private void openSearch(View view) {
    searchBar.setVisibility(View.VISIBLE);
    int[] setLocation = new int[2];
    searchBar.getLocationOnScreen(setLocation);
    int[] sbLocation = new int[2];
    view.getLocationOnScreen(sbLocation);
    Animator animator = searchBar.createCircularReveal(sbLocation[0] - setLocation[0] + view.getWidth() / 2, searchBar.getHeight() / 2, 0, searchBar.getWidth());
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.start();
    searchEditText.requestFocus();
}
Also used : Animator(android.animation.Animator) FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator)

Example 28 with FastOutSlowInInterpolator

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

the class InterpolatorDurationStartDelaySample method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_interpolator, container, false);
    final ViewGroup transitionsContainer = view.findViewById(R.id.transitions_container);
    final View button = transitionsContainer.findViewById(R.id.button);
    button.setOnClickListener(new View.OnClickListener() {

        boolean mToRightAnimation;

        @Override
        public void onClick(View v) {
            mToRightAnimation = !mToRightAnimation;
            Transition transition = new ChangeBounds();
            transition.setDuration(mToRightAnimation ? 700 : 300);
            transition.setInterpolator(mToRightAnimation ? new FastOutSlowInInterpolator() : new AccelerateInterpolator());
            transition.setStartDelay(mToRightAnimation ? 0 : 500);
            TransitionManager.beginDelayedTransition(transitionsContainer, transition);
            FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) button.getLayoutParams();
            params.gravity = mToRightAnimation ? (Gravity.RIGHT | Gravity.TOP) : (Gravity.LEFT | Gravity.TOP);
            button.setLayoutParams(params);
        }
    });
    return view;
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) ViewGroup(android.view.ViewGroup) ChangeBounds(androidx.transition.ChangeBounds) FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator) FrameLayout(android.widget.FrameLayout) Transition(androidx.transition.Transition) View(android.view.View) Nullable(androidx.annotation.Nullable)

Example 29 with FastOutSlowInInterpolator

use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Signal-Android by signalapp.

the class InviteActivity method loadAnimation.

private Animation loadAnimation(@AnimRes int animResId) {
    final Animation animation = AnimationUtils.loadAnimation(this, animResId);
    animation.setInterpolator(new FastOutSlowInInterpolator());
    return animation;
}
Also used : FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator) Animation(android.view.animation.Animation)

Example 30 with FastOutSlowInInterpolator

use of androidx.interpolator.view.animation.FastOutSlowInInterpolator in project Slide by ccrama.

the class CommentAdapterHelper method showChildrenObject.

public static void showChildrenObject(final View v) {
    v.setVisibility(View.VISIBLE);
    ValueAnimator animator = ValueAnimator.ofFloat(0, 1f);
    animator.setDuration(250);
    animator.setInterpolator(new FastOutSlowInInterpolator());
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            float value = (Float) animation.getAnimatedValue();
            v.setAlpha(value);
            v.setScaleX(value);
            v.setScaleY(value);
        }
    });
    animator.start();
}
Also used : FastOutSlowInInterpolator(androidx.interpolator.view.animation.FastOutSlowInInterpolator) ValueAnimator(android.animation.ValueAnimator)

Aggregations

FastOutSlowInInterpolator (androidx.interpolator.view.animation.FastOutSlowInInterpolator)34 ValueAnimator (android.animation.ValueAnimator)8 Animator (android.animation.Animator)6 Animation (android.view.animation.Animation)6 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)4 PropertyValuesHolder (android.animation.PropertyValuesHolder)4 View (android.view.View)4 ObjectAnimator (android.animation.ObjectAnimator)3 ViewGroup (android.view.ViewGroup)3 IEndListener (su.levenetc.android.textsurface.interfaces.IEndListener)3 ISurfaceAnimation (su.levenetc.android.textsurface.interfaces.ISurfaceAnimation)3 AnimatorSet (android.animation.AnimatorSet)2 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)2 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)2 AlphaAnimation (android.view.animation.AlphaAnimation)2 AnticipateInterpolator (android.view.animation.AnticipateInterpolator)2 ScaleAnimation (android.view.animation.ScaleAnimation)2 Nullable (androidx.annotation.Nullable)2 Manifest (android.Manifest)1 TimeInterpolator (android.animation.TimeInterpolator)1