I have a SeekBar in one of my activites in my app.
That seekbar gives me an importance of the object I create. Importance can be 0,1 or 2.
I'd like to dinamically change the background color of my SeekBar when I'm using it. How can I do that ?
Here are the colors I'd like to use :
Importance 0 : "#ff8080"
Importance 1 :"#ff0000"
Importance 2 :"#4d0000"
Thank you for your help, and tell me if you need more code !
BarreImportance.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
if(i==0)
{ //it does not accept my colors..
BarreImportance.getProgressDrawable().setColorFilter(Color.parseColor("#ff8080"));
}
if(i==1)
{
//it changes the whole background, not what I want... BarreImportance.setBackgroundColor(Color.parseColor("#ff0000"));
}