In my application, I have a search bar that should have two states - focused and normal
Not to make progress, I set a normal image in xml like this:
And here is the xml that I use to make progress
bar_normal.xml
<item android:id="@android:id/background" android:drawable="@drawable/black"/> <item android:id="@android:id/secondaryProgress"> <clip android:drawable="@drawable/black" /> </item> <item android:id="@android:id/progress"> <clip android:drawable="@drawable/grey" /> </item>
Now that the user is touching this arrow, I want to change the progress to become orange.
I use another xml for this, and in my code I write like this
seekBar.setProgressDrawable (GetResources () getDrawable (R.drawable.bar_focused).);
bar_focused.xml
<item android:id="@android:id/background" android:drawable="@drawable/black"/> <item android:id="@android:id/secondaryProgress"> <clip android:drawable="@drawable/black" /> </item> <item android:id="@android:id/progress"> <clip android:drawable="@drawable/orange" /> </item>
Initially, the panel looks just fine, with the progress shown in gray and the background, and the secondary progress in black, but when I touch the search button to make it orange, the entire bar turns black. His work remains beautiful, but I do not see the orange color.
Please, help!
source share