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

Fix unexpected ScrollView fling behavior due to Android P bug workaround #34233

Closed

Conversation

dhleong
Copy link
Contributor

@dhleong dhleong commented Jul 20, 2022

Summary

Some custom logic is applied to workaround a platform bug where velocity may be incorrect on Android P. The bug in question appears to have been fixed before Android Q was released, so we shouldn't need to apply the workaround on other versions.

As described in #34226 the workaround can adversely affect certain scroll behaviors, which can easily be reproduced when you briefly scroll one direction then quickly fling the opposite direction (see the video in the linked ticket).

This PR changes the workaround to only be applied on Android P, in order to avoid causing weird scroll behavior on versions that are not actually affected by the bug the workaround is working around.

Changelog

[Android] [Fixed] - Fix occasionally incorrect ScrollView fling behavior

Test Plan

Some custom logic is applied to workaround a platform bug where velocity
may be incorrect on Android P. [The
bug in question](https://issuetracker.google.com/issues/112385925)
appears to have been fixed before Android `Q` was released, so we
shouldn't *need* to apply the workaround on other versions.

As described in facebook#34226
the workaround can adversely affect certain scroll behaviors, which can
easily be reproduced when you briefly scroll one direction then quickly
fling the opposite direction (see the video in the linked ticket).

This PR changes the workaround to *only* be applied on Android P, in
order to avoid causing weird scroll behavior on versions that are not
actually affected by the bug the workaround is working around.
@facebook-github-bot
Copy link
Contributor

Hi @dhleong!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@react-native-bot react-native-bot added Bug Platform: Android Android applications. No CLA Authors need to sign the CLA before a PR can be reviewed. labels Jul 20, 2022
@cortinico
Copy link
Contributor

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Hey @dhleong Can I ask you to sign the CLA so we can move this forward?

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 23, 2022
@react-native-bot react-native-bot removed the No CLA Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2022
@thomasgrivet
Copy link

Hello @dhleong I have this issue on my OnePlus 5T running Android 10, shouldn't this fix already be running on my device? Do you think I'm missing something?

@dhleong
Copy link
Contributor Author

dhleong commented Jul 27, 2022

@thomasgrivet Sorry, I'm not sure I understand your question. This is a proposed change to fix the issue; unless you have merged it into your own fork and are running a custom build of react-native containing this fix, it's unlikely that it would be running on your device.

@facebook-github-bot
Copy link
Contributor

@ryancat has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@ryancat
Copy link
Contributor

ryancat commented Jul 29, 2022

From the linked issue tracker (https://issuetracker.google.com/issues/112385925?pli=1), this issue seems fixed already. We should verify that and drop the workaround all together.

Meanwhile, I think the change here makes sense. Will import and ship.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @dhleong in c7c263d.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 2, 2022
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
…und (facebook#34233)

Summary:
Some custom logic is applied to workaround a platform bug where velocity may be incorrect on Android P. [The bug in question](https://issuetracker.google.com/issues/112385925) appears to have been fixed before Android `Q` was released, so we shouldn't *need* to apply the workaround on other versions.

As described in facebook#34226 the workaround can adversely affect certain scroll behaviors, which can easily be reproduced when you briefly scroll one direction then quickly fling the opposite direction (see the video in the linked ticket).

This PR changes the workaround to *only* be applied on Android P, in order to avoid causing weird scroll behavior on versions that are not actually affected by the bug the workaround is working around.

## Changelog

```
[Android] [Fixed] - Fix occasionally incorrect ScrollView fling behavior
```

Pull Request resolved: facebook#34233

Test Plan:
- Repro the strange fling behavior in the current version (See video attached in facebook#34226)
- Verify that the string fling behavior is fixed with this patch
- Verify that fling behavior still works as expected on Android versions affected by the [original bug](https://issuetracker.google.com/issues/112385925), and those immediately following it (to verify that the bug being worked around was, in fact, fixed as expected).

Reviewed By: javache

Differential Revision: D38287277

Pulled By: ryancat

fbshipit-source-id: 2c786872c4d41655b3849bb92e02f1f16c663b41
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
…und (facebook#34233)

Summary:
Some custom logic is applied to workaround a platform bug where velocity may be incorrect on Android P. [The bug in question](https://issuetracker.google.com/issues/112385925) appears to have been fixed before Android `Q` was released, so we shouldn't *need* to apply the workaround on other versions.

As described in facebook#34226 the workaround can adversely affect certain scroll behaviors, which can easily be reproduced when you briefly scroll one direction then quickly fling the opposite direction (see the video in the linked ticket).

This PR changes the workaround to *only* be applied on Android P, in order to avoid causing weird scroll behavior on versions that are not actually affected by the bug the workaround is working around.

## Changelog

```
[Android] [Fixed] - Fix occasionally incorrect ScrollView fling behavior
```

Pull Request resolved: facebook#34233

Test Plan:
- Repro the strange fling behavior in the current version (See video attached in facebook#34226)
- Verify that the string fling behavior is fixed with this patch
- Verify that fling behavior still works as expected on Android versions affected by the [original bug](https://issuetracker.google.com/issues/112385925), and those immediately following it (to verify that the bug being worked around was, in fact, fixed as expected).

Reviewed By: javache

Differential Revision: D38287277

Pulled By: ryancat

fbshipit-source-id: 2c786872c4d41655b3849bb92e02f1f16c663b41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications. 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.

6 participants