Animate along Y with ObjectAnimator - Android Animation

Android examples for Animation:Animation Creation

Description

Animate along Y with ObjectAnimator

Demo Code


import android.animation.ObjectAnimator;
import android.app.Dialog;
import android.support.v7.widget.RecyclerView;
import android.widget.RelativeLayout;

public class Main{
    public static void AnimateY(RecyclerView.ViewHolder holder) {
        ObjectAnimator animatorTranslateY = ObjectAnimator.ofFloat(
                holder.itemView, "translationY", -75, 0);
        animatorTranslateY.setDuration(1000);
        animatorTranslateY.start();/*from   w w w  . j a  va2 s .  co m*/
    }
}

Related Tutorials