start Translate With Thumb - Android Animation

Android examples for Animation:Translate Animation

Description

start Translate With Thumb

Demo Code


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

import android.view.View;

public class Main {
    public static AnimatorSet startTranslateWithThumb(View thumbView,
            float endPositionX) {
        Integer duration = thumbView.getResources().getInteger(
                android.R.integer.config_shortAnimTime) / 8;
        AnimatorSet as = new AnimatorSet();
        as.playSequentially(ObjectAnimator.ofFloat(thumbView,
                "translationX", endPositionX));
        as.setDuration(duration);/*from w ww  .  j  av  a2s  .c o m*/
        as.start();
        return as;
    }
}

Related Tutorials