zhanghai / MaterialProgressBar

Material Design ProgressBar with consistent appearance
Apache License 2.0
2.21k stars 279 forks source link

Smooth Ticking #90

Closed nurlan-dzhavadov closed 4 years ago

nurlan-dzhavadov commented 4 years ago

Hello everyone! I'm new to coding and I'd like to know how can I make my countdown timer tick smooth, because with this library it ticks every second and as far as I know smooth animation for determinate progress bar is not determined here. I used the Reso Coder tutorial https://www.youtube.com/watch?v=VnRxq4Fpl64&list=PL6qsKvNuUq6mU_XcgzFsEztAFKXnieQz7&index=21&t=275s

I tried to find a solution many many times, searched the right answer, but didn't manage to succeed. Thank you in advance!

zhanghai commented 4 years ago

This is not really a question related to this library because it's about animating the progress value, which can also apply to a framework ProgressBar. StackOverflow would be a better place for these kind of programming questions.

Having said that, you might want to check out ProgressBar.setProgress(int progress, boolean animate) and pass true as animate. However since this API is added in API level 24, you might also want to simulate it on older platform with things like ObjectAnimator, but that's even more out of the scope of this project so I won't talk about its details here.