Java tutorial
//package com.java2s; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.view.View; public class Main { public static ObjectAnimator getChangeAnimator(View view, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { PropertyValuesHolder pvhLeft = PropertyValuesHolder.ofInt("left", oldLeft, left); PropertyValuesHolder pvhTop = PropertyValuesHolder.ofInt("top", oldTop, top); PropertyValuesHolder pvhRight = PropertyValuesHolder.ofInt("right", oldRight, right); PropertyValuesHolder pvhBottom = PropertyValuesHolder.ofInt("bottom", oldBottom, bottom); ObjectAnimator changeAnimator = ObjectAnimator.ofPropertyValuesHolder((Object) view, pvhLeft, pvhTop, pvhRight, pvhBottom); changeAnimator.setDuration(600); return changeAnimator; } }