I have been trying to find a way to change the background color of my relative layout gradually to all colors continuously for example ( soft blue, blue, navy blue, purple, and so on) the code that i have right now only changes the color gradually from black to white. I will be thankful for any help or advice that i may get.
this is the code that i have right now.
layOut = (RelativeLayout)findViewById(R.id.relativeLayout2);
new Thread() {
int color = 0;
public void run() {
for (color = 0; color < 255; color++) {
try {
sleep(20);
runOnUiThread(new Runnable() {
@Override
public void run() {
layOut.setBackgroundColor(Color.argb(255,
color, color, color));
}
});
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();'`enter code here