From d9768f1e616c06f5892ee6fde01c8d5622c504e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D0=BB=D1=8E=D0=BA=20=D0=92=D0=BB?= =?UTF-8?q?=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20=D0=90=D0=BB=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Tue, 23 Apr 2024 11:49:02 +0300 Subject: [PATCH] Update androidx-paging to 3.3.0-alpha03. --- .gitmodules | 2 +- gradle/libs.versions.toml | 4 ++-- paging-common/README.md | 2 +- .../kotlin/app/cash/paging/PagingDataPresenter.kt} | 5 +---- ...{NullPaddedList.kt => PlaceholderPaddedList.kt} | 2 +- ...{PagingDataDiffer.kt => PagingDataPresenter.kt} | 14 +++----------- ...{NullPaddedList.kt => PlaceholderPaddedList.kt} | 6 +++--- .../kotlin/app/cash/paging/PagingDataPresenter.kt} | 5 +---- ...{NullPaddedList.kt => PlaceholderPaddedList.kt} | 2 +- upstreams/androidx-main | 2 +- 10 files changed, 15 insertions(+), 29 deletions(-) rename paging-common/src/{commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt => commonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt} (84%) rename paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/{NullPaddedList.kt => PlaceholderPaddedList.kt} (88%) rename paging-common/src/commonMain/kotlin/app/cash/paging/{PagingDataDiffer.kt => PagingDataPresenter.kt} (83%) rename paging-common/src/commonMain/kotlin/app/cash/paging/{NullPaddedList.kt => PlaceholderPaddedList.kt} (87%) rename paging-common/src/{commonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt => commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt} (84%) rename paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/{NullPaddedList.kt => PlaceholderPaddedList.kt} (88%) diff --git a/.gitmodules b/.gitmodules index d89ed20a9c0..1f0c888aaa1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "upstreams/androidx-main"] path = upstreams/androidx-main url = ./ - branch = androidx-main-3.3.0-alpha02 + branch = androidx-main-3.3.0-alpha03 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2be1477c356..22e12c79cd0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,8 @@ [versions] -android = "8.3.2" +android = "8.2.0" androidx-activity-compose = "1.9.0" androidx-appcompat = "1.6.1" -androidx-paging = "3.3.0-alpha02" +androidx-paging = "3.3.0-alpha03" kotlin = "1.9.23" kotlinx-coroutines = "1.8.0" kotlinx-serialization-json = "1.6.3" diff --git a/paging-common/README.md b/paging-common/README.md index e6ee18d309d..e0775709911 100644 --- a/paging-common/README.md +++ b/paging-common/README.md @@ -118,6 +118,6 @@ Consult the following table for guidance based on which APIs are being used. | `PagingConfig` | Use `createPagingConfig`. | | `PagingData.Companion.empty(LoadStates, LoadStates?)` | Pass in the default value yourself. | | `PagingData.Companion.from(List, LoadStates, LoadStates?)` | Pass in the default value yourself. | -| `PagingDataDiffer` | Pass in the default value yourself. | +| `PagingDataPresenter` | Pass in the default value yourself. | | `PagingLogger.log(Int, String, Throwable?)` | Pass in the default value yourself. | | `PagingSourceLoadResultPage` | Use `createPagingSourceLoadResultPage`. | diff --git a/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt b/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt similarity index 84% rename from paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt rename to paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt index 37eb61586b6..76db4695562 100644 --- a/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt +++ b/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt @@ -19,9 +19,6 @@ package app.cash.paging /** @suppress */ // Constructor has default argument values. @Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS") -actual typealias PagingDataDiffer = androidx.paging.PagingDataDiffer - -/** @suppress */ -actual typealias DifferCallback = androidx.paging.DifferCallback +actual typealias PagingDataPresenter = androidx.paging.PagingDataPresenter actual typealias DiffingChangePayload = androidx.paging.DiffingChangePayload diff --git a/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/NullPaddedList.kt b/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt similarity index 88% rename from paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/NullPaddedList.kt rename to paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt index c1058ad14a6..b7a82263583 100644 --- a/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/NullPaddedList.kt +++ b/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt @@ -17,4 +17,4 @@ package app.cash.paging /** @suppress */ -actual typealias NullPaddedList = androidx.paging.NullPaddedList +actual typealias PlaceholderPaddedList = androidx.paging.PlaceholderPaddedList diff --git a/paging-common/src/commonMain/kotlin/app/cash/paging/PagingDataDiffer.kt b/paging-common/src/commonMain/kotlin/app/cash/paging/PagingDataPresenter.kt similarity index 83% rename from paging-common/src/commonMain/kotlin/app/cash/paging/PagingDataDiffer.kt rename to paging-common/src/commonMain/kotlin/app/cash/paging/PagingDataPresenter.kt index e34a0d61296..c52fc946243 100644 --- a/paging-common/src/commonMain/kotlin/app/cash/paging/PagingDataDiffer.kt +++ b/paging-common/src/commonMain/kotlin/app/cash/paging/PagingDataPresenter.kt @@ -21,8 +21,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlin.coroutines.CoroutineContext /** @suppress */ -expect abstract class PagingDataDiffer( - differCallback: DifferCallback, +expect abstract class PagingDataPresenter( /* default = Dispatchers.Main */ mainContext: CoroutineContext, /* default = null */ @@ -30,8 +29,8 @@ expect abstract class PagingDataDiffer( ) { abstract suspend fun presentNewList( - previousList: NullPaddedList, - newList: NullPaddedList, + previousList: PlaceholderPaddedList, + newList: PlaceholderPaddedList, lastAccessedIndex: Int, onListPresentable: () -> Unit, ): Int? @@ -65,13 +64,6 @@ expect abstract class PagingDataDiffer( fun removeLoadStateListener(listener: (CombinedLoadStates) -> Unit) } -/** @suppress */ -expect interface DifferCallback { - fun onChanged(position: Int, count: Int) - fun onInserted(position: Int, count: Int) - fun onRemoved(position: Int, count: Int) -} - expect enum class DiffingChangePayload { ITEM_TO_PLACEHOLDER, PLACEHOLDER_TO_ITEM, diff --git a/paging-common/src/commonMain/kotlin/app/cash/paging/NullPaddedList.kt b/paging-common/src/commonMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt similarity index 87% rename from paging-common/src/commonMain/kotlin/app/cash/paging/NullPaddedList.kt rename to paging-common/src/commonMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt index 33299239074..36b4546758c 100644 --- a/paging-common/src/commonMain/kotlin/app/cash/paging/NullPaddedList.kt +++ b/paging-common/src/commonMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt @@ -17,10 +17,10 @@ package app.cash.paging /** @suppress */ -expect interface NullPaddedList { +expect interface PlaceholderPaddedList { val placeholdersBefore: Int - fun getFromStorage(localIndex: Int): T val placeholdersAfter: Int val size: Int - val storageCount: Int + val dataCount: Int + fun getItem(index: Int): T } diff --git a/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt b/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt similarity index 84% rename from paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt rename to paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt index 37eb61586b6..76db4695562 100644 --- a/paging-common/src/commonAndroidXMain/kotlin/app/cash/paging/PagingDataDiffer.kt +++ b/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PagingDataPresenter.kt @@ -19,9 +19,6 @@ package app.cash.paging /** @suppress */ // Constructor has default argument values. @Suppress("NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS") -actual typealias PagingDataDiffer = androidx.paging.PagingDataDiffer - -/** @suppress */ -actual typealias DifferCallback = androidx.paging.DifferCallback +actual typealias PagingDataPresenter = androidx.paging.PagingDataPresenter actual typealias DiffingChangePayload = androidx.paging.DiffingChangePayload diff --git a/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/NullPaddedList.kt b/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt similarity index 88% rename from paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/NullPaddedList.kt rename to paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt index c1058ad14a6..b7a82263583 100644 --- a/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/NullPaddedList.kt +++ b/paging-common/src/commonNonAndroidXMain/kotlin/app/cash/paging/PlaceholderPaddedList.kt @@ -17,4 +17,4 @@ package app.cash.paging /** @suppress */ -actual typealias NullPaddedList = androidx.paging.NullPaddedList +actual typealias PlaceholderPaddedList = androidx.paging.PlaceholderPaddedList diff --git a/upstreams/androidx-main b/upstreams/androidx-main index 9cb4b0abdc4..616490fe032 160000 --- a/upstreams/androidx-main +++ b/upstreams/androidx-main @@ -1 +1 @@ -Subproject commit 9cb4b0abdc4a6aae1d9b633199e299d9ed9bd9ba +Subproject commit 616490fe03253dd0a91bebd6b43b94f851d4a224