Repository navigation
Conversation
RecyclerView estimated the scroll offset as the laid-out rows' average length times the rows above them, so offsets, content size, edge distances and the anchoring threshold drifted with row lengths. 118 dp down the React example it read 73 dp, under an autoscrollToTopThreshold of 100. Both layout managers now read offset, range and extent from the offset model, which pull to refresh and the scroll bars read too.
… length A row above the viewport that measured at another length than its estimate moved the offset with no scroll, so onScroll could keep the old value until the next scroll step. A card above row 300 in the React example moved it by 84 dp. A layout pass that moves the offset now sends a scroll event, as UIKit does when it adjusts contentOffset.
scrollToOffset scrolled by the distance from RecyclerView's estimated
offset, so scrollTo({ y: 400 }) stopped at 415 when the rows above it had
other heights. It now lands on the row that holds the offset, plus the
remainder, through the same jump as scrollToIndex: React rows render before
it lands, and data that changes before the landing moves the landing with
it. An animated scroll jumps near a far target first, then glides to that row.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
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.
stacked on #47. Android took its scroll offset from RecyclerView's estimate: the average length of the laid-out rows times the rows above them. rows of different heights threw it off, so
scrollTo({ y: 400 })stopped at 415. 118 dp down the React example the offset read 73 dp, under anautoscrollToTopThresholdof 100, so a prepend there would scroll the list to the top.both layout managers now read offset, range and extent from the offset model. onScroll, the content size, the edge events, the anchoring threshold, pull to refresh and the scroll bars all get the real offset. when a row above the viewport measures and moves the offset without a scroll, a scroll event goes out, as UIKit does.
scrollToOffsetandscrollTonow land on the row that holds the offset, plus the remainder, through the same jump asscrollToIndex. React rows render before it lands, and an offset sent right after an index in the same frame now wins. an instantscrollToOffsetto the end of the React example used to take frames of 48 to 85 ms, now none goes over 32 ms.