Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android ]fix onMomentumScrollEnd similar to iOS #45187

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Biki-das
Copy link
Contributor

@Biki-das Biki-das commented Jun 26, 2024

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 extra onMomentumScrollEnd 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 changes

Screen.Recording.2024-06-26.at.8.12.08.PM.mov
Screen.Recording.2024-06-26.at.8.41.55.PM.mov

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jun 26, 2024
@Biki-das
Copy link
Contributor Author

cc @NickGerleman @javache

@Biki-das
Copy link
Contributor Author

@cipolleschi would also love to know your thoughts as well.

@Biki-das Biki-das changed the title [Android ]fix onMomentum scroll end similar to iOS [Android ]fix onMomentumScrollEnd similar to iOS Jun 26, 2024
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 20,300,225 -15,772
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 23,497,181 -16,121
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: e6dd44d
Branch: main

@cipolleschi
Copy link
Contributor

Android is not really my area of expertise, so @javache and @cortinico would be better reviewers.

A couple of points though:

  • The 2 different events could be there because of Old Arch/New Arch variants
  • The Android code in the PR seems to tackle only the Old Architecture. Could you see if the New Architecture has the same problem? We are hyper focused on the New Arch, so Old Arch-only fixes are lower priorities for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants