Search in sources :

Example 41 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Euclid by Yalantis.

the class EuclidActivity method createOpenProfileButtonAnimation.

/**
     * This method, if needed, creates and setups animation of scaling button from 0 to 1.
     */
private void createOpenProfileButtonAnimation() {
    if (mProfileButtonShowAnimation == null) {
        mProfileButtonShowAnimation = AnimationUtils.loadAnimation(this, R.anim.profile_button_scale);
        mProfileButtonShowAnimation.setDuration(getAnimationDurationShowProfileButton());
        mProfileButtonShowAnimation.setInterpolator(new AccelerateInterpolator());
        mProfileButtonShowAnimation.setAnimationListener(new Animation.AnimationListener() {

            @Override
            public void onAnimationStart(Animation animation) {
                mButtonProfile.setVisibility(View.VISIBLE);
            }

            @Override
            public void onAnimationEnd(Animation animation) {
            }

            @Override
            public void onAnimationRepeat(Animation animation) {
            }
        });
    }
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) Animation(android.view.animation.Animation)

Example 42 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project StarWars.Android by Yalantis.

the class SideFragment method createCheckoutRevealAnimator.

protected Animator createCheckoutRevealAnimator(final ClipRevealFrame view, int x, int y, float startRadius, float endRadius) {
    setMenuVisibility(false);
    Animator retAnimator;
    mRadius = endRadius;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        retAnimator = ViewAnimationUtils.createCircularReveal(view, x, y, startRadius, endRadius);
    } else {
        view.setClipOutLines(true);
        view.setClipCenter(x, y);
        view.setClipRadius(startRadius);
        retAnimator = ObjectAnimator.ofFloat(view, "clipRadius", startRadius, endRadius);
    }
    retAnimator.setDuration(ANIM_DURATION);
    retAnimator.addListener(new Animator.AnimatorListener() {

        @Override
        public void onAnimationStart(Animator animation) {
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            view.setClipOutLines(false);
            removeOldSideFragment();
        }

        @Override
        public void onAnimationCancel(Animator animation) {
        }

        @Override
        public void onAnimationRepeat(Animator animation) {
        }
    });
    retAnimator.setInterpolator(new AccelerateInterpolator(2.0f));
    return retAnimator;
}
Also used : Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) AccelerateInterpolator(android.view.animation.AccelerateInterpolator)

Example 43 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Side-Menu.Android by Yalantis.

the class MainActivity method replaceFragment.

private ScreenShotable replaceFragment(ScreenShotable screenShotable, int topPosition) {
    this.res = this.res == R.drawable.content_music ? R.drawable.content_films : R.drawable.content_music;
    View view = findViewById(R.id.content_frame);
    int finalRadius = Math.max(view.getWidth(), view.getHeight());
    SupportAnimator animator = ViewAnimationUtils.createCircularReveal(view, 0, topPosition, 0, finalRadius);
    animator.setInterpolator(new AccelerateInterpolator());
    animator.setDuration(ViewAnimator.CIRCULAR_REVEAL_ANIMATION_DURATION);
    findViewById(R.id.content_overlay).setBackgroundDrawable(new BitmapDrawable(getResources(), screenShotable.getBitmap()));
    animator.start();
    ContentFragment contentFragment = ContentFragment.newInstance(this.res);
    getSupportFragmentManager().beginTransaction().replace(R.id.content_frame, contentFragment).commit();
    return contentFragment;
}
Also used : ContentFragment(yalantis.com.sidemenu.sample.fragment.ContentFragment) AccelerateInterpolator(android.view.animation.AccelerateInterpolator) SupportAnimator(io.codetail.animation.SupportAnimator) BitmapDrawable(android.graphics.drawable.BitmapDrawable) View(android.view.View)

Example 44 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Side-Menu.Android by Yalantis.

the class ViewAnimator method animateView.

private void animateView(int position) {
    final View view = viewList.get(position);
    view.setVisibility(View.VISIBLE);
    FlipAnimation rotation = new FlipAnimation(90, 0, 0.0f, view.getHeight() / 2.0f);
    rotation.setDuration(ANIMATION_DURATION);
    rotation.setFillAfter(true);
    rotation.setInterpolator(new AccelerateInterpolator());
    rotation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            view.clearAnimation();
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    view.startAnimation(rotation);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) FlipAnimation(yalantis.com.sidemenu.animation.FlipAnimation) FlipAnimation(yalantis.com.sidemenu.animation.FlipAnimation) Animation(android.view.animation.Animation) ImageView(android.widget.ImageView) View(android.view.View)

Example 45 with AccelerateInterpolator

use of android.view.animation.AccelerateInterpolator in project Side-Menu.Android by Yalantis.

the class ViewAnimator method animateHideView.

private void animateHideView(final int position) {
    final View view = viewList.get(position);
    FlipAnimation rotation = new FlipAnimation(0, 90, 0.0f, view.getHeight() / 2.0f);
    rotation.setDuration(ANIMATION_DURATION);
    rotation.setFillAfter(true);
    rotation.setInterpolator(new AccelerateInterpolator());
    rotation.setAnimationListener(new Animation.AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            view.clearAnimation();
            view.setVisibility(View.INVISIBLE);
            if (position == viewList.size() - 1) {
                animatorListener.enableHomeButton();
                drawerLayout.closeDrawers();
            }
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });
    view.startAnimation(rotation);
}
Also used : AccelerateInterpolator(android.view.animation.AccelerateInterpolator) FlipAnimation(yalantis.com.sidemenu.animation.FlipAnimation) FlipAnimation(yalantis.com.sidemenu.animation.FlipAnimation) Animation(android.view.animation.Animation) ImageView(android.widget.ImageView) View(android.view.View)

Aggregations

AccelerateInterpolator (android.view.animation.AccelerateInterpolator)186 Animator (android.animation.Animator)62 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)54 View (android.view.View)52 ObjectAnimator (android.animation.ObjectAnimator)41 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)40 ImageView (android.widget.ImageView)26 AnimatorSet (android.animation.AnimatorSet)24 TextView (android.widget.TextView)23 Animation (android.view.animation.Animation)21 ValueAnimator (android.animation.ValueAnimator)17 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)14 LinearInterpolator (android.view.animation.LinearInterpolator)14 TranslateAnimation (android.view.animation.TranslateAnimation)14 OvershootInterpolator (android.view.animation.OvershootInterpolator)13 Point (android.graphics.Point)12 Paint (android.graphics.Paint)10 Interpolator (android.view.animation.Interpolator)9 AlphaAnimation (android.view.animation.AlphaAnimation)8 AnticipateOvershootInterpolator (android.view.animation.AnticipateOvershootInterpolator)8