Android examples for User Interface:RecyclerView
animate Heal on RecyclerView
import android.animation.Animator; import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.support.v7.widget.RecyclerView; import android.view.View; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.view.animation.OvershootInterpolator; public class Main{ public static void animateHeal(RecyclerView.ViewHolder holder, boolean goesDown) { ObjectAnimator animatorScaleX;//from w ww.j a v a 2 s .c o m int x = goesDown ? 100 : -100; if (goesDown) animatorScaleX = ObjectAnimator.ofFloat(holder.itemView, "translationY", x, 0); else animatorScaleX = ObjectAnimator.ofFloat(holder.itemView, "translationY", x, 0); animatorScaleX.setDuration(1000); animatorScaleX.start(); } }