Search in sources :

Example 56 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project react-native-navigation by wix.

the class TitleBar method show.

public void show(@Nullable final Runnable onDisplayed) {
    setAlpha(0);
    animate().alpha(1).setDuration(200).setInterpolator(new AccelerateDecelerateInterpolator()).setListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            if (onDisplayed != null) {
                onDisplayed.run();
            }
        }
    });
}
Also used : Animator(android.animation.Animator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Example 57 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PersistentSearch by KieronQuinn.

the class SearchBox method revealFrom.

private void revealFrom(float x, float y, Activity a, SearchBox s) {
    FrameLayout layout = (FrameLayout) a.getWindow().getDecorView().findViewById(android.R.id.content);
    RelativeLayout root = (RelativeLayout) s.findViewById(R.id.search_root);
    Resources r = getResources();
    float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 96, r.getDisplayMetrics());
    int finalRadius = (int) Math.max(layout.getWidth(), px);
    SupportAnimator animator = ViewAnimationUtils.createCircularReveal(root, (int) x, (int) y, 0, finalRadius);
    animator.setInterpolator(new AccelerateDecelerateInterpolator());
    animator.setDuration(500);
    animator.addListener(new SupportAnimator.AnimatorListener() {

        @Override
        public void onAnimationCancel() {
        }

        @Override
        public void onAnimationEnd() {
            toggleSearch();
        }

        @Override
        public void onAnimationRepeat() {
        }

        @Override
        public void onAnimationStart() {
        }
    });
    animator.start();
}
Also used : SupportAnimator(io.codetailps.animation.SupportAnimator) FrameLayout(android.widget.FrameLayout) RelativeLayout(android.widget.RelativeLayout) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Resources(android.content.res.Resources)

Example 58 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project PersistentSearch by KieronQuinn.

the class ViewAnimationUtils method liftingFromBottom.

/**
     * Lifting view
     *
     * @param view The animation target
     * @param baseRotation initial Rotation X in 3D space
     * @param duration aniamtion duration
     */
public static void liftingFromBottom(View view, float baseRotation, int duration) {
    ViewHelper.setRotationX(view, baseRotation);
    ViewHelper.setTranslationY(view, view.getHeight() / 3);
    ViewPropertyAnimator.animate(view).setInterpolator(new AccelerateDecelerateInterpolator()).setDuration(duration).rotationX(0).translationY(0).start();
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Example 59 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project SpotiQ by ZinoKader.

the class StartupActivity method prepareCircularRevealAnimation.

private Animator prepareCircularRevealAnimation() {
    Animator circularRevealAnimation;
    //calculate bounds
    int x = binding.root.getWidth() / 2;
    int y = binding.root.getHeight() / 2;
    int startRadius = binding.logInButton.getWidth();
    int endRadius = (int) Math.hypot(binding.root.getWidth(), binding.root.getHeight());
    //hide unwanted views
    binding.root.setVisibility(View.GONE);
    binding.logInButton.setVisibility(View.GONE);
    binding.spotiqLogo.setVisibility(View.GONE);
    //prepare root view color
    binding.root.setBackgroundColor(ContextCompat.getColor(this, R.color.colorAccent));
    binding.root.setVisibility(View.VISIBLE);
    circularRevealAnimation = ViewAnimationUtils.createCircularReveal(binding.root, x, y, startRadius, endRadius);
    circularRevealAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
    return circularRevealAnimation;
}
Also used : Animator(android.animation.Animator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator)

Example 60 with AccelerateDecelerateInterpolator

use of android.view.animation.AccelerateDecelerateInterpolator in project Material-Movies by saulmm.

the class GUIUtils method startScaleAnimationFromPivot.

public static void startScaleAnimationFromPivot(int pivotX, int pivotY, final View v, final AnimatorListener animatorListener) {
    final AccelerateDecelerateInterpolator interpolator = new AccelerateDecelerateInterpolator();
    v.setScaleY(SCALE_START_ANCHOR);
    v.setPivotX(pivotX);
    v.setPivotY(pivotY);
    v.getViewTreeObserver().addOnPreDrawListener(new ViewTreeObserver.OnPreDrawListener() {

        @Override
        public boolean onPreDraw() {
            v.getViewTreeObserver().removeOnPreDrawListener(this);
            ViewPropertyAnimator viewPropertyAnimator = v.animate().setInterpolator(interpolator).scaleY(1).scaleX(1).setDuration(SCALE_DELAY);
            if (animatorListener != null)
                viewPropertyAnimator.setListener(animatorListener);
            viewPropertyAnimator.start();
            return true;
        }
    });
}
Also used : AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) ViewTreeObserver(android.view.ViewTreeObserver) ViewPropertyAnimator(android.view.ViewPropertyAnimator)

Aggregations

AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)165 ValueAnimator (android.animation.ValueAnimator)38 ObjectAnimator (android.animation.ObjectAnimator)31 Animator (android.animation.Animator)30 View (android.view.View)30 AnimatorSet (android.animation.AnimatorSet)22 Animation (android.view.animation.Animation)19 Handler (android.os.Handler)15 NonNull (android.support.annotation.NonNull)12 TranslateAnimation (android.view.animation.TranslateAnimation)12 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)11 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)10 AlphaAnimation (android.view.animation.AlphaAnimation)10 ImageView (android.widget.ImageView)10 TextView (android.widget.TextView)10 Paint (android.graphics.Paint)9 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)9 LinearInterpolator (android.view.animation.LinearInterpolator)9 ScaleAnimation (android.view.animation.ScaleAnimation)9 PropertyValuesHolder (android.animation.PropertyValuesHolder)8