0

I have a SeekBar that I'm trying to implement custom styling on. The edges of my progressDrawable have rounded corners which I think looks great, however when i drag the thumb to the edges it looks strange.

This is how the SeekBar looks when I use an "in the middle" progress value like 80. seekbar_80

And this is how the start and end look when I use a progress value of 0 or 100 respectively. You can see how the rounded corners look strange due to the way the thumb goes all the way to the end of the SeekBar.

seekbar_0

seekbar_100

I'm looking for a way to get the thumb to STOP at around 16dp before the end of the SeekBar, but for the progressDrawable to still fill it in as if it had gone to 100.

I also just noticed that the thumb seems to cut off half way through it's drawable. That is not related to what I'm asking, so I'm trying to avoid any confusion there.

Nathan F.
  • 3,250
  • 3
  • 35
  • 69
  • Might be worth a peek at: [Custom seekbar (thumb size, color and background](https://stackoverflow.com/questions/41693154/custom-seekbar-thumb-size-color-and-background/42168717#42168717) `android:splitTrack="false` **comments** so the thumb does not show white corners when moving. – Jon Goodwin Oct 02 '19 at 22:23
  • @JonGoodwin this already has that, the problem is that since i use a drawable with rounded corners for both the thumb and the seekbar you get this weird shape in it: https://i.imgur.com/yxlCv1b.png – Nathan F. Oct 13 '19 at 14:16
  • ok I will take a look. Stackoverflow has a problem with your name Nathan F. probable the full stop. – Jon Goodwin Oct 13 '19 at 15:56
  • Nathan F What I see is [Rastering](https://en.wikipedia.org/wiki/Raster_graphics), maybe a video (gif) would help explain ? Vectors will fix it (vectors scale). – Jon Goodwin Oct 13 '19 at 16:34
  • @JonGoodwin I'm looking for a way to get the thumb to STOP at around 16dp before the end of the SeekBar, but for the progressDrawable to still fill it in as if it had gone to 100. – Nathan F. Oct 13 '19 at 17:01
  • That is easy to do. Sorry I'm moving house, no time.... – Jon Goodwin Oct 13 '19 at 17:03
  • @JonGoodwin still moving house? – Nathan F. Jan 14 '20 at 00:54
  • Moved now, but no WiFi until end of January, then move again, pub and library WiFi until then, but now I have time... – Jon Goodwin Jan 14 '20 at 20:24
  • Have you got any code I can work with, looks like [clipping](https://en.wikipedia.org/wiki/Clipping_(computer_graphics)), but that should not be happening – Jon Goodwin Jan 15 '20 at 11:08
  • @JonGoodwin there is no code involved here, only a few drawables. But you can replicate this fairly easily. Just use drawables with rounded corners for the drawables on your progress bar and you will see the same effect. Unfortunately I don't have the project any more, but I'm still very curious what the answer might be. – Nathan F. Jan 21 '20 at 16:03

0 Answers0