Reputation: 1
I want to make seekbar like this: http://img687.imageshack.us/img687/2371/volumec.png
The thing is, that Ive already found customizing seekbars over here http://groups.google.com/group/android-developers/browse_thread/thread/be3fed0b4f766cc?pli=1
but the problem is, that I need **those gaps** between in my drawable and I don
t know how to manage that.
Would you be so kind some of you, I`ll appreciate it very much.
Thanks in advance, wishing all the best!
this is my resources style.xml file that is applied to seekbar:
<item name="android:indeterminateOnly">false</item>
<item name="android:progressDrawable">@drawable/seekbarcolors</item>
<item name="android:indeterminateDrawable">@drawable/seekbarcolors</item>
<item name="android:minHeight">20dip</item>
<item name="android:maxHeight">20dip</item>
<item name="android:thumbOffset">8px</item>
<item name="android:focusable">true</item>
and here is my @drawable/seekbarcolors:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<solid android:color="#ff0000" />
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<solid android:color="#00ff00" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="#0000ff" />
</shape>
</clip>
</item>
Upvotes: 0
Views: 8264
Reputation: 534
To change Volume bar colour in android In framework/core/res/res/layout change colour in volume_adjust.xml
Upvotes: 0
Reputation: 1
The thing is that i need to seek volume..as you can see, i' ve styled seekbar with my custom shape where colors are set Last thing i need to do is create repeatable shape with block of opacity 1 and block with opacity 0. How this can be done? I am new to android developmemt therefore not very smart with shapes :) thanks
Upvotes: 0
Reputation: 3243
A Seekbar is a pretty powerful widget. Ddo you want the user to be able to "seek" the volume here? It's not made to show progress with gaps.
What you need here (if you don't need to grab and seek the volume) is lots simpler. Create a single ImageView to the right of "Volume" in your sample pic. In your progress-watching AsyncTask, put code in onProgressUpdate() to change the shown image across 10 images - each the same as the last but with one more bar - as progress breaks each 10%. You can write code to put a single image times properly positioned across a space, but that is harder and buys you little.
Upvotes: 1