Android examples for android.animation:ObjectAnimator
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 . j av a2s. c o m animator.setEvaluator(new ArgbEvaluator()); animator.start(); } }