Android examples for android.animation:Animator
Move ScrollView Animator
//package com.java2s; import android.animation.Animator; import android.animation.ObjectAnimator; import android.view.View; import android.view.animation.AccelerateDecelerateInterpolator; public class Main { public static Animator moveScrollViewToX(View view, int toX, int time, int delayTime, boolean isStart) { ObjectAnimator objectAnimator = ObjectAnimator.ofInt(view, "scrollX", new int[] { toX }); objectAnimator.setDuration(time); objectAnimator//from ww w . j av a 2s . co m .setInterpolator(new AccelerateDecelerateInterpolator()); objectAnimator.setStartDelay(delayTime); if (isStart) objectAnimator.start(); return objectAnimator; } }