Fixed
Status Update
Comments
du...@google.com <du...@google.com> #2
Thanks for reporting this and providing some code snippets! Additionally, if you have a project I would be able to clone that reproduces the issue it would definitely help as well!
jd...@xooloo.com <jd...@xooloo.com> #3
You can clone this:
Run the Main Activity, scroll to the end of the list: I join a screen of the issue.
du...@google.com <du...@google.com> #4
Thanks for providing a sample project! Looks like this is an issue with how we conflate item accesses when triggering prefetch.
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 190a76ec743552627310e024976fd5896e989acb
Author: Dustin Lam <dustinlam@google.com>
Date: Mon Sep 28 13:54:08 2020
Prioritize hints from more recent presenter state
Currently we only use itemsPresentedAfter, which only accounts for the
placeholderOffset from the last page, but this value is insufficient to
determine which hint loads more items in cases where the last/first
pageOffset changes on presenter side.
As a result, we'll drop hints that would load more items in favor of
hints that came from a past presenter state that was scroll further into
placeholders.
This change fixes the above by always prioritizing new incoming hints if
the first/last pageOffset of presenter state changes.
RelNote: "N/A"
Fixes: 169259468
Test: ./gradlew paging:paging-common:test
Change-Id: Iffda3a0eb7abe162045893367b4781daf75adb01
M paging/common/api/current.txt
M paging/common/api/public_plus_experimental_current.txt
M paging/common/api/restricted_current.txt
M paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
https://android-review.googlesource.com/1441095
Branch: androidx-master-dev
commit 190a76ec743552627310e024976fd5896e989acb
Author: Dustin Lam <dustinlam@google.com>
Date: Mon Sep 28 13:54:08 2020
Prioritize hints from more recent presenter state
Currently we only use itemsPresentedAfter, which only accounts for the
placeholderOffset from the last page, but this value is insufficient to
determine which hint loads more items in cases where the last/first
pageOffset changes on presenter side.
As a result, we'll drop hints that would load more items in favor of
hints that came from a past presenter state that was scroll further into
placeholders.
This change fixes the above by always prioritizing new incoming hints if
the first/last pageOffset of presenter state changes.
RelNote: "N/A"
Fixes: 169259468
Test: ./gradlew paging:paging-common:test
Change-Id: Iffda3a0eb7abe162045893367b4781daf75adb01
M paging/common/api/current.txt
M paging/common/api/public_plus_experimental_current.txt
M paging/common/api/restricted_current.txt
M paging/common/src/main/kotlin/androidx/paging/PageFetcherSnapshot.kt
M paging/common/src/test/kotlin/androidx/paging/PageFetcherSnapshotTest.kt
Description
Component used: Paging3 Version used: alpha06 Devices/Android versions reproduced on: Android 7.1
I'm presenting a list of items using data from a room DB.
Note: The page size is intentionally low to try to debug paging issues, but is higher in production code.
The pager flow is used to produce
PagingData
passed to aPagingAdapter
.The RecyclerView uses a simple LinearLayoutManager.
Everything work mostly fine except that that latest entry may never be loaded while scrolling (especially when scrolling slowly). The PagingData properly provides a placeholder that is shown in the list, but it never trigger the loading of the last data, and so never replace the placeholder when reaching the end of the list.