Java tutorial
//package com.java2s; import android.animation.ObjectAnimator; import android.view.View; public class Main { public static ObjectAnimator moveY(View view, int time, float... value) { return animateFloatProperty(view, "TranslationY", time, value); } private static ObjectAnimator animateFloatProperty(Object target, String propertyName, int time, float... value) { ObjectAnimator oa = ObjectAnimator.ofFloat(target, propertyName, value); oa.setDuration(time); return oa; } }