move Left ObjectAnimator - Android android.animation

Android examples for android.animation:ObjectAnimator

Description

move Left ObjectAnimator

Demo Code


//package com.java2s;
import android.animation.ObjectAnimator;

public class Main {
    private static float x = 0;
    private static long duration = 1500;

    public static void moveLeft(Object v, float end) {
        x -= end;//w w w .j a v a  2  s  . c om
        ObjectAnimator.ofFloat(v, "translationX", x).setDuration(duration)
                .start();
    }
}

Related Tutorials