I am using RangeSeekBar to set some values for 3 conditions (i.e. Green=OK,Amber=Warning, Red=evacuate)... I am using xml drawable to set the backgroung like this
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#27F70C"
android:centerColor="#FFBF00"
android:endColor="#FC0505"
android:angle="0" />
<corners android:radius="0px" />
<stroke
android:width="2dp"
android:color="#70555555" />
<stroke
android:width="0dp"
android:color="#70555555" />
</shape>
which results like this
Now I want to change the background colour according to the seekbar values so that If I change the range it should change the background colour something like this
I know I can change the gradient programmatically but how to narrow down start color and increase end colour ? Anyone has a solution for this ?
Thanks