I have created a style that extends the material seekbar in android to make the horizontal bar thicker I would also like to increase the size of the thumb that is dragged. I don't want to change the thumb just use the normal #drawable/scrubber_control_material_anim.
Related
I am trying to create a custom seekbar. I have used vectors for progress drawable and thumb as:
android:thumb="#drawable/custom_seekbar_thumb"
android:progressDrawable="#drawable/custom_seekbar_progress"
android:splitTrack="false"
Right now my seekbar looks like this:
As you can see the pink vector image that I have used for progressDrawable doesn't occupy the entire width of seekbar - there is some gap between the drawable and seekbar in the right side.
How do I make my progress drawable occupy the entire width of the seekbar?
Fixed this issue simply by using android:paddingEnd="0dp" in Seekbar.
I have a question about a seekbar.
Everything works perfect, but I have a Problem with the background and the thumb.
I can add a background with a special size of the thumb. If I change the size of the seekbar the background size will change identical to the seekbar size but
the thumb keeps the original size. (I know that I can change the width and the height of the thumb with the attributes.)
Now the question: Is there a way that the thumb changes automatically the size when I change the seekbar size inside the activity_main like the background.
I need this for a special LED Bar.
I hope this pictures will help to understand it
image1
image2
The frame is the Background of the seekbar. If i change the size the frame size will be changed automatically. The thumb will not changed
How can i increase seekbar thickness? I would like to have this horizontal line very thick plus have thumb with much bigger circle. (holo.light)
Do I really have to create my own drabawbles? I hoped that changing only some attributes would be enough....
I am having problem with custom seek bar I am not getting same as i expect, I am using 2nd image as progress drawable and first as thumb, but when i use wrap content it is small and when i use fill parent it is repeating and the seek bar different from the 2nd image in the UI?
You should use Nine-path graphics. With this android will automatically resize your image based on borders you provide in graphics.
set maxHeight and minHeight of seekbar properties.
example:
maxHeight = 40dp
minHeight = 40dp
I'm having problems with a custom seekbar thumb (aka scrubber control). The thumb is clipping whenever I press on it, then goes away once I drag it. I've already added padding to the right and left of the seekbar to accommodate the thumb at the ends. This image shows what's happening at different stages of progress and while idle at either end:
I've also tried adding a thumb offset to the seekbar: android:thumbOffset="0dp". The result is no more clipping when pressed, but now the scrubber control does not move to the very end of the bar on either side. This image shows the seekbar with thumbOffset:
All of the scrubber control drawables are the same size, so the image size isn't changing size when the state becomes pressed. Is there some way to get no clipping while pressed and still have the scrubber control move to the very ends of the bar?
Use PaddingLeft and PaddingRight and thumbOffset attribute for your SeekBar.
Try setting your padding AND your thumbOffset to half the width of your thumb.
I.e. if the width of your thumb is 30, set padding="15dp" and thumbOffset="15dp"