move Top ObjectAnimator - Android android.animation

Android examples for android.animation:ObjectAnimator

Description

move Top ObjectAnimator

Demo Code


//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();
    }
}

Related Tutorials