This would increase the flexibility developers have regarding automated scrolling, e.g. a 1,000 item list should not be scrolled to the end at the same speed as a 10 item list does. If you'd like I would add a PR for this feature :)
I just want to use this for passing speed from PanResponder and scroll
any Update ?
@Daniel Cochran any update on this ?
I'm giving this a shot, at least for Android:
Anyone up for tackling the iOS side?
Huge pain point, this one issue means many simple scenarios with React Native can never live up to the quality of a native implementation.
Any update of this?
I disagree with dhorrigan about this being worth it (but thank you for the technical overview!). The native scroll speeds are abysmal under certain circumstances that require, for example, rapid speed with eased endings to traverse a large distance.
@dhorrigan Thanks for your insightful feedback, I thought this would be easier to do.
I like the idea, but would add complexity in the core that I am not sure is worth it...
On iOS, it uses setContentOffset:animated: to do the scrolling, which doesn't allow setting the speed (uses the native ios animation). To achieve this, it could use UIView:animateWithDuration:animations:, however, this has a lot of unwanted side-affects (like animating changes made in delegate methods and such). Given this, it would probably have to use a NSTimer to manually update the offset every 1/10 of a second or so over the wanted duration. This is pretty complicated, error prone, and could have performance implications.
On Android, it uses smoothScrollTo, which again, uses the native android animation. A custom animation duration here is actually pretty simple, it would just have to use ObjectAnimator.ofInt to scroll to the new offset (it would have to determine which axis to scroll, but that is simple).