Animate along X with ObjectAnimator - Android Animation

Android examples for Animation:Animation Creation

Description

Animate along X 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 AnimateX(RecyclerView.ViewHolder holder) {
        ObjectAnimator animatorTranslateY = ObjectAnimator.ofFloat(
                holder.itemView, "scaleY", 0.5F, 0.8F, 1.0F);
        animatorTranslateY.setDuration(1000);
        animatorTranslateY.start();/*from   w ww .  j av  a 2s. c o m*/
    }
}

Related Tutorials