Android examples for android.animation:ObjectAnimator
show Up And Down Bounce ObjectAnimator
//package com.java2s; import android.animation.Animator; import android.animation.ObjectAnimator; import android.view.View; import android.view.animation.OvershootInterpolator; public class Main { public static Animator showUpAndDownBounce(View view, int translationY, int animatorTime, boolean isStartAnimator, boolean isStartInterpolator) { ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationY", translationY); if (isStartInterpolator) { objectAnimator.setInterpolator(new OvershootInterpolator()); }// w w w . j a va 2 s . c o m objectAnimator.setDuration(animatorTime); if (isStartAnimator) { objectAnimator.start(); } return objectAnimator; } }