[Android ]fix onMomentumScrollEnd similar to iOS #45187
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
in iOS on a scroll generated programatically, the
onMomentScrollEnd
is fired, though in case of android the same does not happen, this PR tries to implement the same behaviour for android as well, while diving through the code it seems we have two extraonMomentumScrollEnd
events. Only one event should be fired.iOS Behaviour on Programmatic Scroll
Screen.Recording.2024-06-26.at.8.18.46.PM.mov
Screen.Recording.2024-06-26.at.8.50.00.PM.mov
Android Behaviour on Programmatic Scroll
Screen.Recording.2024-06-26.at.8.19.28.PM.mov
Screen.Recording.2024-06-26.at.8.51.15.PM.mov
If closely observed we can see the
onMomentumScrollEnd
does not gets called in Android unlike to iOS.Changelog:
[Android] [Fixed] - fix onMomentum scroll end similar to iOS
Test Plan:
i have added updates to the FlatList example and ScrollViewSimple
here is a ScreenRecording of
onMomentumScrollEnd
firing in android after the code changesScreen.Recording.2024-06-26.at.8.12.08.PM.mov
Screen.Recording.2024-06-26.at.8.41.55.PM.mov