move Right ObjectAnimator - Android android.animation

Android examples for android.animation:ObjectAnimator

Description

move Right 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 moveRight(Object v, int end) {
        x += end;//from  w  w  w .j  a v  a 2  s  .  co m
        ObjectAnimator.ofFloat(v, "translationX", x).setDuration(duration)
                .start();
    }
}

Related Tutorials