I want to create a dynamic intermittent progress bar (as illustrated in the image below), that will change its intervals depending on the user's choice, in Android Studio.
The idea is that the user will choose how many times he wishes to do a behavior, and then the bar will fragment accordingly. Then each time they do the behavior, the bar will color a step increment, as shown in the image below.
I am looking for some general guidance on how to do it, since I am new to this.
I have thought of 3 ways to do this:
Have a ton of png. drawables or vectors for each case, and use one accordingly in an Image View. (seems kind of stupid to me)
Create as many views as are the intervals, and then change the view colors accordingly (in this case there will be a problem with the dynamic part of it i.e. interval variability)
Customize somehow a horizontal ProgressBar to do this automatically.
I have searched the internet for the third way which is the most elegant to me, but cant find an answer.
Thank you for your time.