Java tutorial
//package com.java2s; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.view.View; public class Main { public static void animateColor(View view, int colorFrom, int colorTo) { final View mView = view; final ValueAnimator va = ObjectAnimator.ofArgb(colorFrom, colorTo); va.setDuration(300); va.addUpdateListener(animation -> mView.setBackgroundColor((Integer) animation.getAnimatedValue())); va.start(); } }