Android examples for android.animation:ObjectAnimator
Create show Background Color Animation ObjectAnimator
//package com.java2s; import android.animation.ArgbEvaluator; import android.animation.ObjectAnimator; import android.view.View; public class Main { public static void showBackgroundColorAnimation(View view, int preColor, int currColor, int duration) { ObjectAnimator animator = ObjectAnimator.ofInt(view, "backgroundColor", new int[] { preColor, currColor }); animator.setDuration(duration);/*from w w w.ja v a 2 s. co m*/ animator.setEvaluator(new ArgbEvaluator()); animator.start(); } }