Search in sources :

Example 6 with Animator

use of android.animation.Animator in project Launcher3 by chislon.

the class LauncherViewPropertyAnimator method onAnimationRepeat.

@Override
public void onAnimationRepeat(Animator animation) {
    for (int i = 0; i < mListeners.size(); i++) {
        Animator.AnimatorListener listener = mListeners.get(i);
        listener.onAnimationRepeat(this);
    }
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) AnimatorListener(android.animation.Animator.AnimatorListener)

Example 7 with Animator

use of android.animation.Animator in project Launcher3 by chislon.

the class LauncherViewPropertyAnimator method onAnimationEnd.

@Override
public void onAnimationEnd(Animator animation) {
    for (int i = 0; i < mListeners.size(); i++) {
        Animator.AnimatorListener listener = mListeners.get(i);
        listener.onAnimationEnd(this);
    }
    mRunning = false;
}
Also used : Animator(android.animation.Animator) ViewPropertyAnimator(android.view.ViewPropertyAnimator) AnimatorListener(android.animation.Animator.AnimatorListener)

Example 8 with Animator

use of android.animation.Animator in project kickmaterial by byoutline.

the class CategoriesListActivity method runFinishAnimation.

private void runFinishAnimation(Runnable finishAction) {
    if (summaryScrolledValue > 0) {
        binding.categoriesRv.smoothScrollToPosition(0);
    }
    ViewUtils.showView(binding.selectCategoryTv, false);
    ObjectAnimator imageFade = ObjectAnimator.ofFloat(binding.selectedCategoryIv, View.ALPHA, 1, 0);
    AnimatorSet set = new AnimatorSet();
    AnimatorSet closeButtonScale = AnimatorUtils.getScaleAnimator(binding.closeCategoriesIv, 1, 0.1f);
    set.playTogether(closeButtonScale, imageFade);
    set.setDuration(FINISH_ANIMATION_DURATION);
    set.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationEnd(Animator animation) {
            if (revealAnimation != null) {
                revealAnimation.cancel();
            }
            ViewUtils.showView(binding.categoryCircleRevealIv, false);
            binding.closeCategoriesIv.setScaleX(0);
            binding.closeCategoriesIv.setScaleY(0);
            finishAction.run();
        }
    });
    binding.categoriesRv.startAnimation(LUtils.loadAnimationWithLInterpolator(getApplicationContext(), R.anim.slide_to_bottom));
    set.start();
}
Also used : Animator(android.animation.Animator) ObjectAnimator(android.animation.ObjectAnimator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) AnimatorSet(android.animation.AnimatorSet)

Example 9 with Animator

use of android.animation.Animator in project cw-omnibus by commonsguy.

the class AsyncDemoFragment method changeMenuIconAnimation.

// based on https://goo.gl/3IUM8K
private void changeMenuIconAnimation(final FloatingActionMenu menu) {
    AnimatorSet set = new AnimatorSet();
    final ImageView v = menu.getMenuIconView();
    ObjectAnimator scaleOutX = ObjectAnimator.ofFloat(v, "scaleX", 1.0f, 0.2f);
    ObjectAnimator scaleOutY = ObjectAnimator.ofFloat(v, "scaleY", 1.0f, 0.2f);
    ObjectAnimator scaleInX = ObjectAnimator.ofFloat(v, "scaleX", 0.2f, 1.0f);
    ObjectAnimator scaleInY = ObjectAnimator.ofFloat(v, "scaleY", 0.2f, 1.0f);
    scaleOutX.setDuration(50);
    scaleOutY.setDuration(50);
    scaleInX.setDuration(150);
    scaleInY.setDuration(150);
    scaleInX.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            v.setImageResource(menu.isOpened() ? R.drawable.ic_action_settings : R.drawable.ic_close);
        }
    });
    set.play(scaleOutX).with(scaleOutY);
    set.play(scaleInX).with(scaleInY).after(scaleOutX);
    set.setInterpolator(new OvershootInterpolator(2));
    menu.setIconToggleAnimatorSet(set);
}
Also used : ObjectAnimator(android.animation.ObjectAnimator) Animator(android.animation.Animator) OvershootInterpolator(android.view.animation.OvershootInterpolator) ObjectAnimator(android.animation.ObjectAnimator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) AnimatorSet(android.animation.AnimatorSet) ImageView(android.widget.ImageView)

Example 10 with Animator

use of android.animation.Animator in project UltimateAndroid by cymcsg.

the class DetailActivity3 method animateRevealShow.

private void animateRevealShow(View viewRoot) {
    int cx = (viewRoot.getLeft() + viewRoot.getRight()) / 2;
    int cy = (viewRoot.getTop() + viewRoot.getBottom()) / 2;
    int finalRadius = Math.max(viewRoot.getWidth(), viewRoot.getHeight());
    Animator anim = ViewAnimationUtils.createCircularReveal(viewRoot, cx, cy, 0, finalRadius);
    viewRoot.setVisibility(View.VISIBLE);
    anim.setDuration(ANIM_DURATION);
    anim.start();
}
Also used : Animator(android.animation.Animator)

Aggregations

Animator (android.animation.Animator)1384 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)848 ObjectAnimator (android.animation.ObjectAnimator)712 ValueAnimator (android.animation.ValueAnimator)627 AnimatorSet (android.animation.AnimatorSet)278 View (android.view.View)227 ViewGroup (android.view.ViewGroup)110 ArrayList (java.util.ArrayList)101 PropertyValuesHolder (android.animation.PropertyValuesHolder)94 Paint (android.graphics.Paint)78 StackStateAnimator (com.android.systemui.statusbar.stack.StackStateAnimator)75 ImageView (android.widget.ImageView)68 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)66 AnimatorUpdateListener (android.animation.ValueAnimator.AnimatorUpdateListener)65 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)61 TextView (android.widget.TextView)60 RenderNodeAnimator (android.view.RenderNodeAnimator)51 ViewPropertyAnimator (android.view.ViewPropertyAnimator)50 Rect (android.graphics.Rect)49 Interpolator (android.view.animation.Interpolator)49