Kushal Kushal - 4 months ago 15
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 Source

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