Kushal Kushal - 7 days ago 4
Android Question

Background color change (every second a slight change)

Can anyone please tell me how to implement the background which slightly change every second as shown in the picture.

Answer

This May Help You

ValueAnimator colorAnim = ObjectAnimator.ofInt(**myView**, "backgroundColor", Color.RED, Color.BLUE);

            colorAnim.setDuration(3000);
            colorAnim.setEvaluator(new ArgbEvaluator());
            colorAnim.setRepeatCount(ValueAnimator.INFINITE);
            colorAnim.setRepeatMode(ValueAnimator.REVERSE);
            colorAnim.start();

Where myView is the view on which you want to apply Animation