anastr / SpeedView

Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
Apache License 2.0
1.28k stars 321 forks source link

clock.setTicknumber(0) will leave ticklabels at the min and max clock values. #207

Closed jilleb closed 3 years ago

jilleb commented 3 years ago

Describe the bug It's not possible to have 0 ticklabels.

To Reproduce When setting Ticknumber to 0, to prevent displaying ticks, it will still display 2 tick labels: clock.setTicknumber(0) image

When setting the number to 1, only the lowest value is shown (which is to be expected): image

It will never display 0 ticklabels. I have to admit.. the placement of the 2 labels is beautiful and actually nicer than what I have when I enabled the 9 ticks. ;-) (for completeness, here's the view with 9 ticks on) image

Currently I solved it by setting the tickColor to transparent when I want to have it disabled.

Other Great work. Using this repository on a daily basis in my app. I would love to do some sponsoring, but the sponsoring-link in the wiki sends me back to the main page.

anastr commented 3 years ago

Hi @jilleb You shouldn't face this issue if you were using ImageSpeedometer. Anyway, this issue caused by drawDefMinMaxSpeedPosition, this method draw the very old position of static tow ticks (at min and max position). And I keep it for old users and as you said it's at a better position. Setting the color to transparent is a good workaround, also you can change the the tick's label to empty like so:

speedometer.onPrintTickLabel = { _, _ -> "" }

Thanks for willing to sponsor this project, but sponsoring option isn't allowed in my country, not even e-payment. Have a good day 😄.

jilleb commented 3 years ago

That's actually a beautiful solution! I hope to be able to buy you a drink some day !