Fix virtualization logic with horizontal RTL lists#38529
Closed
NickGerleman wants to merge 2 commits into
Closed
Conversation
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
Base commit: d380bb8 |
1ff698d to
8bfc118
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
1 similar comment
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
8bfc118 to
4e3e6d2
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
4e3e6d2 to
2c6449a
Compare
2c6449a to
3255cdd
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
3255cdd to
3ce1744
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
Summary: This changes the logic we use to correct scroll position on RTL ScrollView content change, to a new more generalized strategy of keeping a constant right-edge offset on layout change. This includes first layout, so that the initial scroll position is correct. Differential Revision: D47627115 fbshipit-source-id: c8964046dcb4cf33424a593e1372a3a8dd3a91df
Summary: Pull Request resolved: facebook#38529 VirtualizedList internally represents metrics along the scrolling axis using `offset` (x, y), and `length` (width, height). This one dimensional representation allows the list to be generic to being horizontal or vertical. Right now offset conversion directly takes the `x` or `y` axis value, but this is not correct when we are using a horizontal FlatList in RTL. This change converts most VirtualizedList code handling `offset,length` coordinates consistently flow from start to end, including in horizontal RTL and in inverted FlatList. This is paired with a fix to Android native code in D47627115. With these together, basic Horizontal FlatList scenarios should work correctly when laid out in RTL. Changelog: [General][Fixed] - Fix virtualization logic with horizontal RTL lists Reviewed By: vincentriemer Differential Revision: D46586420 fbshipit-source-id: 6224fc310035766f7b2473adfd170093119524a7
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D46586420 |
3ce1744 to
49c7cb6
Compare
Contributor
|
This pull request has been merged in 8b39bfa. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
VirtualizedList internally represents metrics along the scrolling axis using
offset(x, y), andlength(width, height). This one dimensional representation allows the list to be generic to being horizontal or vertical.Right now offset conversion directly takes the
xoryaxis value, but this is not correct when we are using an inverted FlatList, or a horizontal FlatList in RTL.This change converts most VirtualizedList code handling
offset,lengthcoordinates consistently flow from start to end, including in horizontal RTL and in inverted FlatList.This is paired with a fix to Android native code in D47627115. With these together, basic Horizontal FlatList scenarios should work correctly when laid out in RTL.
Differential Revision: D46586420