Search in sources :

Example 46 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project ViewAnimator by florent37.

the class MainActivity method animateParallel.

protected void animateParallel() {
    final ViewAnimator viewAnimator = ViewAnimator.animate(mountain, image).dp().translationY(-1000, 0).alpha(0, 1).singleInterpolator(new OvershootInterpolator()).andAnimate(percent).scale(0, 1).andAnimate(text).textColor(Color.BLACK, Color.WHITE).backgroundColor(Color.WHITE, Color.BLACK).waitForHeight().singleInterpolator(new AccelerateDecelerateInterpolator()).duration(2000).thenAnimate(percent).custom(new AnimationListener.Update<TextView>() {

        @Override
        public void update(TextView view, float value) {
            view.setText(String.format(Locale.US, "%.02f%%", value));
        }
    }, 0, 1).andAnimate(image).rotation(0, 360).duration(5000).start();
    new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {

        @Override
        public void run() {
            viewAnimator.cancel();
        }
    }, 3000);
}
Also used : ViewAnimator(com.github.florent37.viewanimator.ViewAnimator) OvershootInterpolator(android.view.animation.OvershootInterpolator) AccelerateDecelerateInterpolator(android.view.animation.AccelerateDecelerateInterpolator) Handler(android.os.Handler) TextView(android.widget.TextView) AnimationListener(com.github.florent37.viewanimator.AnimationListener)

Example 47 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project InstaMaterial by frogermcs.

the class PublishActivity method loadThumbnailPhoto.

private void loadThumbnailPhoto() {
    ivPhoto.setScaleX(0);
    ivPhoto.setScaleY(0);
    Picasso.with(this).load(photoUri).centerCrop().resize(photoSize, photoSize).into(ivPhoto, new Callback() {

        @Override
        public void onSuccess() {
            ivPhoto.animate().scaleX(1.f).scaleY(1.f).setInterpolator(new OvershootInterpolator()).setDuration(400).setStartDelay(200).start();
        }

        @Override
        public void onError() {
        }
    });
}
Also used : Callback(com.squareup.picasso.Callback) OvershootInterpolator(android.view.animation.OvershootInterpolator)

Example 48 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project ListenerMusicPlayer by hefuyicoder.

the class LyricView method smoothScrollTo.

/**
     * 从当前位置滑动到指定位置上
     * @param toY  指定纵坐标位置
     * */
private void smoothScrollTo(float toY) {
    final ValueAnimator animator = ValueAnimator.ofFloat(mScrollY, toY);
    animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {

        @Override
        public void onAnimationUpdate(ValueAnimator animation) {
            if (mUserTouch) {
                animator.cancel();
                return;
            }
            mScrollY = (float) animation.getAnimatedValue();
            invalidateView();
        }
    });
    animator.addListener(new AnimatorListenerAdapter() {

        @Override
        public void onAnimationStart(Animator animation) {
            super.onAnimationStart(animation);
            mSliding = true;
        }

        @Override
        public void onAnimationEnd(Animator animation) {
            super.onAnimationEnd(animation);
            mSliding = false;
            measureCurrentLine();
            invalidateView();
        }
    });
    animator.setDuration(640);
    animator.setInterpolator(new OvershootInterpolator(0.5f));
    animator.start();
}
Also used : Animator(android.animation.Animator) ValueAnimator(android.animation.ValueAnimator) OvershootInterpolator(android.view.animation.OvershootInterpolator) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ValueAnimator(android.animation.ValueAnimator)

Example 49 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project MusicDNA by harjot-oberai.

the class NewPlaylistFragment method onResume.

@Override
public void onResume() {
    super.onResume();
    mLayoutManager2.scrollToPositionWithOffset(0, 0);
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            savePlaylist.animate().scaleX(1.0f).scaleY(1.0f).setDuration(300).setInterpolator(new OvershootInterpolator());
        }
    }, 500);
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) Handler(android.os.Handler)

Example 50 with OvershootInterpolator

use of android.view.animation.OvershootInterpolator in project MusicDNA by harjot-oberai.

the class RecentsFragment method onResume.

@Override
public void onResume() {
    super.onResume();
    mLayoutManager2.scrollToPositionWithOffset(0, 0);
    new Handler().postDelayed(new Runnable() {

        @Override
        public void run() {
            shuffleFab.animate().scaleX(1.0f).scaleY(1.0f).setDuration(300).setInterpolator(new OvershootInterpolator());
        }
    }, 500);
}
Also used : OvershootInterpolator(android.view.animation.OvershootInterpolator) Handler(android.os.Handler)

Aggregations

OvershootInterpolator (android.view.animation.OvershootInterpolator)85 ObjectAnimator (android.animation.ObjectAnimator)32 Animator (android.animation.Animator)21 View (android.view.View)21 AnimatorSet (android.animation.AnimatorSet)15 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)14 TextView (android.widget.TextView)14 AccelerateInterpolator (android.view.animation.AccelerateInterpolator)13 Handler (android.os.Handler)12 ValueAnimator (android.animation.ValueAnimator)10 LinearInterpolator (android.view.animation.LinearInterpolator)10 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)8 Drawable (android.graphics.drawable.Drawable)7 RecyclerView (android.support.v7.widget.RecyclerView)7 AccelerateDecelerateInterpolator (android.view.animation.AccelerateDecelerateInterpolator)7 LayerDrawable (android.graphics.drawable.LayerDrawable)6 PropertyValuesHolder (android.animation.PropertyValuesHolder)5 Rect (android.graphics.Rect)5 Interpolator (android.view.animation.Interpolator)5 Point (android.graphics.Point)4