Closed rafd closed 8 years ago
I like the percentage idea! Thanks for pointing out the issue, I hadn't considered that. PR is very welcome if you have time.
@rafd are you planning on submitting a PR for this? If so I'd like to include it so that you get attribution. If this has dropped off your radar, no problem, I can make the change.
I've been traveling for the past month and haven't been able to get to it. Feel free to make the change.
@rafd Ok, I've changed it to use % as you suggested,
new jar is out
[reanimated "0.4.0"]
Note that the package name has changed from
[timothypratley/reanimated "0.3.0"]
to just 'reanimated'
I was trying to use
spring
to transition a value from0
to0.1
, which in other parts of the application is multiplied by100
. However, becausespring
usessmall
to determine if to animate or just stop at the final value, and thesmall
threshold is absolute (currently0.1
), it makes usingspring
with small values infeasible (because it doesn't transition, just immediately jumps to the end).I was able to make it work by going from
0
to100
instead, but, I think there could be general solution.Perhaps instead of an absolute threshold, the threshold could be a percent of the difference between the initial and final value (ex. 1%, so for 0 to 100, it would be 1; and for 0 to 0.1 it would be 0.01).
Or, perhaps there is a better approach than absolute or percentage based.
Thoughts?
I'd be willing to do figure it out and do a PR.