Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//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 localObjectAnimator = ObjectAnimator.ofInt(view, "backgroundColor",
                new int[] { preColor, currColor });
        localObjectAnimator.setDuration(duration);
        localObjectAnimator.setEvaluator(new ArgbEvaluator());
        localObjectAnimator.start();
    }
}