robinhood / ticker

An Android text view with scrolling text change animation
https://medium.com/robinhood-engineering/hello-ticker-20eaf6e51689
Apache License 2.0
4.38k stars 462 forks source link

Animation isn't idempotent #113

Closed gpeal closed 3 years ago

gpeal commented 4 years ago

I'm testing this ticker view on a dial that can be scrubbed incrementally. If I scrub slowly through numbers, the tens place animation restarts even though it doesn't change. Kapture 2020-02-22 at 2 42 35

In this case, I would expect the tens digit to settle smoothly no matter if the ones digit animation changes.

Ignore the fact that it's not monospace, that's something I'll have to bring up with our designers.

jinatonic commented 4 years ago

🤔 I have not seen this behavior with my testing, are you sure you aren't setting intermediate values in between those animations? The view moving left and right is super strange to me.

Let me see if I can repro on a sample app.

gpeal commented 4 years ago

@jinatonic The moving left and right is because it's not a monospaced font so ignore that part.

It's setting whole integer values but they may get set before the previous number has settled. In that case, it appears as if the animation interpolation starts over from that point making it not smooth.

Thanks for making and open sourcing this library though!

jinatonic commented 4 years ago

Gotcha, yep ok I know the issue you are talking about, will take some time to investigate it this weekend.