robinhood / spark

A simple Android sparkline chart view.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add animation types

raoninovellino opened this issue · comments

Hi, I want to add animation type support, and add other animation type.

Add animation type support is to make easy for someone create other type of animations.

Add a animation other than draw the line. The animation animates the line from where it is until where it was updated, each point.

I create a animation type enum, with "none", "line" and "point" animation.
Animation type "line" is the default one. "none" is for no animation and "point" is the new animation type.

sparkAnime.zip

I really love this new animation!

I think what we'd like to do is come up with something a bit more extensible around animations. Maybe some kind of SparkAnimator that you can set on the SparkView and do whatever animations you want. Then nobody is limited to just the line or point animation, they can write anything they come up with.

Good, I will make a new pull request with this feature.

Looking at the video, it seems like you already have implemented this?

So, this new animation would trigger when we setup the data points initially and when dataset changes?

Yes, I implemented it, but not with a parent Animator class, like you commented. Now, I have a good new implementation. Look the new pull request.

I think the logic is the same, but when setup data points initially, it does not animate, only animates when dataset changes.

Was closed in #27

Thanks again for all the work here!