Fixed
Status Update
Comments
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit ca034507266a55c23a6b79e732fdbb7262cad096
Author: Clara Fok <clarafok@google.com>
Date: Fri Aug 26 11:42:32 2022
Add support for custom context in collectAsLazyPagingItems
Context is defaulted to Dispatchers.Main for backcompat.
Test: ./gradlew paging:paging-compose:cC
Fixes: 243182795
Fixes: 233896435
Fixes: 233783862
Relnote: Add support for a custom CoroutineContext when calling collectLazyPagingItems on a Flow<PagingData<T>>
Change-Id: I7a57418bcbd9ab86ddcbed3313b00aa82bf2398f
M paging/paging-compose/src/main/java/androidx/paging/compose/LazyPagingItems.kt
M paging/paging-compose/api/public_plus_experimental_current.txt
M paging/paging-compose/build.gradle
M paging/paging-compose/api/restricted_current.txt
M paging/paging-compose/api/current.txt
M paging/paging-compose/src/androidTest/java/androidx/paging/compose/LazyPagingItemsTest.kt
https://android-review.googlesource.com/2199396
Branch: androidx-main
commit ca034507266a55c23a6b79e732fdbb7262cad096
Author: Clara Fok <clarafok@google.com>
Date: Fri Aug 26 11:42:32 2022
Add support for custom context in collectAsLazyPagingItems
Context is defaulted to Dispatchers.Main for backcompat.
Test: ./gradlew paging:paging-compose:cC
Fixes: 243182795
Fixes: 233896435
Fixes: 233783862
Relnote: Add support for a custom CoroutineContext when calling collectLazyPagingItems on a Flow<PagingData<T>>
Change-Id: I7a57418bcbd9ab86ddcbed3313b00aa82bf2398f
M paging/paging-compose/src/main/java/androidx/paging/compose/LazyPagingItems.kt
M paging/paging-compose/api/public_plus_experimental_current.txt
M paging/paging-compose/build.gradle
M paging/paging-compose/api/restricted_current.txt
M paging/paging-compose/api/current.txt
M paging/paging-compose/src/androidTest/java/androidx/paging/compose/LazyPagingItemsTest.kt
na...@google.com <na...@google.com> #3
The following release(s) address this bug:
androidx.paging:paging-compose:1.0.0-alpha17
Description
Paging currently supports collecting
Flow<PagingData>
from non-main thread, which is useful for controlling the context in which all of Paging's initialization and object creation happens. It also control the default context for transforms, since that is applied on the internalFlow<PageEvent>
which is collected from call to.submitData()
.Unfortunately, collecting
PagingData
and calling.submitData
all happen internally in paging-compose so there is no way to control this behavior if usingLazyPagingItems
.Ideally we can make the context configurable, but if not we should at least have a more sane default.