-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Scroll and restore position correctly in Home and Notifications (#…
…1240) These are cached timelines, backed by Room. Room **requires** the `PagingConfig` to have `enablePlaceholders = true`. Otherwise the list is corrupted when scrolling down the list and paging in new items. To restore the user's reading position correctly in the UI, wait for the adapter to emit the very first page. Combine this with the user's refresh key, and the number of placeholders in the page, to scroll the user to the correct place in the list. To make all this work, ensure that Room loads a large enough page of data around the refresh key (in the `initialKey` calculation).
- Loading branch information
1 parent
ebdd586
commit 0a42ab0
Showing
6 changed files
with
75 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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