Fixed
Status Update
Comments
da...@google.com <da...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
Author: Eva <
Link:
[GH] room-paging refresh initial load fix
Expand for full commit details
[GH] room-paging refresh initial load fix
## Proposed Changes
If items are removed then the initial key for a refresh may be close enough to the end of the list that fewer than a screens-worth of items may be loaded causing the UI to jump. Changed to handle similarly to the case where the initial key larger than itemCount and load loadSize items from the end.
## Testing
Test: ./gradlew test connectedCheck
## Issues Fixed
Fixes: b/389729367
This is an imported pull request from https://github.com/androidx/androidx/pull/750.
Resolves #750
Github-Pr-Head-Sha: e01574c59eaeb92cffd0cd1606b213b7fc5af475
GitOrigin-RevId: a6c2d92a4012757817fd74af4fc1a57fb6de8f88
Change-Id: I2abbe92633bf95aa3306e4c2ebc47eacebfffa8c
Files:
- M
room/integration-tests/kotlintestapp/src/androidTest/java/androidx/room/integration/kotlintestapp/test/MultiTypedPagingSourceTest.kt
- M
room/room-paging/src/androidInstrumentedTest/kotlin/androidx/room/paging/LimitOffsetPagingSourceTest.kt
- M
room/room-paging/src/commonMain/kotlin/androidx/room/paging/util/RoomPagingUtil.kt
Hash: 79ddb7ed533cc8808a3ae3c52d36cb3f5ef0602b
Date: Tue Jan 14 08:04:43 2025
na...@google.com <na...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-paging:2.7.0-alpha13
androidx.room:room-paging-android:2.7.0-alpha13
androidx.room:room-paging-iosarm64:2.7.0-alpha13
androidx.room:room-paging-iossimulatorarm64:2.7.0-alpha13
androidx.room:room-paging-iosx64:2.7.0-alpha13
androidx.room:room-paging-jvm:2.7.0-alpha13
androidx.room:room-paging-linuxarm64:2.7.0-alpha13
androidx.room:room-paging-linuxx64:2.7.0-alpha13
androidx.room:room-paging-macosarm64:2.7.0-alpha13
androidx.room:room-paging-macosx64:2.7.0-alpha13
Description
Component used: room, room-paging Version used: 2.7.0-alpha12 Devices/Android versions reproduced on: emulator
Steps to reproduce:
This appears to be caused by the logic inhttps://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:room/room-paging/src/commonMain/kotlin/androidx/room/paging/util/RoomPagingUtil.kt;drc=6d0e4120b9ea66164e1f3c1d93e711fac2aed847;l=76
specifically, if the refresh key lands within the last page it'll load fewer items than expected.
Changing
to
should fix it.