-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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] [Lists] Workaround a wrong fling direction for inverted ScrollViews on Android P #21117
Conversation
59cf86c
to
107a9ec
Compare
// | ||
// Hence, we can use the absolute value from whatever the OS gives | ||
// us and use the sign of what mOnScrollDispatchHelper has tracked. | ||
velocityY = (int)(Math.abs(velocityY) * Math.signum(mOnScrollDispatchHelper.getYFlingVelocity())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this and is working, what is not so good practice in general is changing the argument value, instead create a new var. Thank you for this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing!
I’m away from my laptop this week, will address you comment on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Ruben's feedback, once the PR is updated I'll try to import it :) Thanks for doing this btw 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot!
Yeah, I agree about a variable, just wanted to make a smallest possible diff.
I fixed it and rebased to the latest master
.
We will be using this in production until it gets merged! 👍 CC: @listicos who reviewed this for us on our team! |
107a9ec
to
f9ed777
Compare
f9ed777
to
1ae9b9a
Compare
Generated by 🚫 dangerJS |
Hey Igor, thanks! I'll try to trigger the import, but can't assure when it will land because this past week the FB team seemed super busy 🤷♂️ @facebook-github-bot shipit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kelset is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@mandrigin merged commit b971c5b into |
…d P (#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes #19434 Pull Request resolved: #21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
…d P (facebook#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes facebook#19434 Pull Request resolved: facebook#21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
…d P (facebook#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes facebook#19434 Pull Request resolved: facebook#21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
…d P (facebook#21117) Summary: This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925 It is based on a fact that even though `fling` receive a wrong sign in `velocityY`, `mOnScrollDispatchHelper.getYFlingVelocity()` still returns a fling direction. Fixes facebook#19434 Pull Request resolved: facebook#21117 Differential Revision: D13082740 Pulled By: hramos fbshipit-source-id: 1b28586d2c7bdcae4a111d3cead4a0455cebb99a
This is a safe workaround to an issue in Android P: https://issuetracker.google.com/issues/112385925
It is based on a fact that even though
fling
receive a wrong sign invelocityY
,mOnScrollDispatchHelper.getYFlingVelocity()
still returns a fling direction.Fixes #19434
Test Plan:
inverted={true}
.Expected:
On Android 8 and 9 the behaviour is the same.
Release Notes:
[ANDROID] [BUGFIX] [ScrollView] - Workaround a wrong fling direction for inverted ScrollViews on Android P