tankery / CircularSeekBar

Custom circular SeekBar (Circle, Semi-circle, and Ellipse) for Android
Apache License 2.0
376 stars 60 forks source link

Progress 0 looks like it has progress #16

Closed adriancoman closed 5 years ago

adriancoman commented 5 years ago

When setting the progress to 0, it looks like the progress is 1 or a very small number. Any way to make it not visible at all?

Besides changing the color of the progress to gray and back to blue when I need it.

Screenshot 2019-05-09 at 16 52 26

tankery commented 5 years ago

Sorry that the behavior is expected currently, but I think it's a proper feature request for this library.

What do you think if I add an attribute, say hide_progress_when_empty, to allow developer hide the progress when it comes to 0?

BTW, what did you mean by "changing the color to gray and back to blue"? Sorry I don't get it.

adriancoman commented 5 years ago

What i meant was that in order to "fake" the view and show it has no progress, I did it like this: in xml:

app:cs_circle_color="@color/referral_gray_bg"
app:cs_circle_progress_color="@color/referral_gray_bg"

And then when I started to add progress to the view, I set the circleProgressColor from code:

if (progress == 1) {
    progressView.circleProgressColor = Color.parseColor("#418be7")
}
tankery commented 5 years ago

I see, that's a little bit hacky for sure :)

Anyway, I'm going to add an attribute cs_hide_progress_when_empty="true|false" to support your needs.

tankery commented 5 years ago

This feature is supported now, upgrade the library to 1.2.0 to have a try.

Thanks for your feedback!