Android examples for android.animation:ObjectAnimator
move Top ObjectAnimator
//package com.java2s; import android.animation.ObjectAnimator; public class Main { private static float y = 0; private static long duration = 1500; public static void moveTop(Object v, int end) { y -= end;/*from w ww . j a v a 2 s . c om*/ ObjectAnimator.ofFloat(v, "translationY", y).setDuration(duration) .start(); } }