Files
react-native/ReactAndroid
Xin Chen 3352b57a6f Make fling animator customizable
Summary:
This diff makes the fling animator cuztomizable, so that the subclasses can have their own animation for fling behavior.

Before the diff, we rely on the `OverScroller` to `fling`, which has some issues with Spline interpolation being messed up due to the clamped fling distance (See more details in T105464095). This may not be a big issue for mobile when user touches screen, but in VR environment this shows up very clearly with joystick events. To fix that properly without affecting mobile behavior, I added a new interface `HasFlingAnimator` from the helper, and implemented with default fling animator in the OSS ScrollView.

We should consider adopt a suitable animator for mobile platform, as the non-smooth fling effect is also happening in mobile.

- Add interface `HasFlingAnimator` to `ReactScrollView` and `ReactHorizontalScrollView`
- Add default fling animator
- Depend on if the default animator is used, customize the flingAndSnap behavior

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D32382806

fbshipit-source-id: 08f03350f6a9b9fc03414b4dcb9977b9f33603ba
2021-11-29 14:56:14 -08:00
..
2021-11-29 14:56:14 -08:00

Building React Native for Android

See the docs on the wiki.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing.