Search code examples
androidandroid-studioandroid-custom-viewandroid-progressbarandroid-seekbar

How to make a Circular SeekBar with a customizable thumb?


I'm using Android Studio and I need to have a component like this:

SeekBar, circular and with a customized thumb

Those features are important: - progressDrawable that accepts gradient colors; - thumb that I can get as a component in order to animate or to put texts above it (like in the image); - thumb that I can customize with images, not just colors; - the ProgressBar/SeekBar must have a circular shape. - I want to be able to set the progress programmatically for animation purposes;

I've made researches about it and I could only get close to the result that I wanted, but it's not enough. By using Sliders, I could customize the thumb as I wanted, but I don't have control over the background to set it bit by bit as in a ProgressBar. By using SeekBars or ProgressBars I need to choose between customize the thumb or making the component circular.

Is there any way to do it?

Or at least, I would be satisfied if I could use a regular Circular SeekBar, but having access to the position of the thumb so I could replace it with a component of my choice.

Thanks for the attention!


Solution

  • Is there any way to do it?

    Well, There's always many ways to do it!

    There are lots of libraries that do it for you, so there is no need to re-invent the wheel, but in your case I think you probably must invent your custom wheel because all the options you're looking for is not in a library together, However these may make you happy! : SeekArc , CircularSeekBar and CircularSeekBar.

    But if they didn't satisfy your needs, you can simply fork and add your custom options to them. Maybe you should take a look at RoundedBitmapDrawable in case you want to add a circular bitmap to the SeekBar and RadialGradient if you want use gradient color for it.

    If you need a tutorial for creating a custom View on your own this can help: Creating custom and compound views in Android - Tutorial

    Good luck with that