From dddd22e0a6b8f6667084961f0d5a8f28767ee59b Mon Sep 17 00:00:00 2001 From: Honza Date: Mon, 4 Sep 2023 14:05:01 +0200 Subject: [PATCH] Fix Detekt warning --- demo-app/build.gradle.kts | 1 + .../demoapp/ui/screen/transactions/view/TransactionsView.kt | 5 ++++- gradle.properties | 1 + settings.gradle.kts | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/demo-app/build.gradle.kts b/demo-app/build.gradle.kts index 0fe25e31b..55f174cdb 100644 --- a/demo-app/build.gradle.kts +++ b/demo-app/build.gradle.kts @@ -137,6 +137,7 @@ dependencies { implementation(libs.bundles.grpc) implementation(libs.kotlinx.datetime) + implementation(libs.kotlinx.immutable) } fladle { diff --git a/demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/ui/screen/transactions/view/TransactionsView.kt b/demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/ui/screen/transactions/view/TransactionsView.kt index e7fccfd04..a9f9522d6 100644 --- a/demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/ui/screen/transactions/view/TransactionsView.kt +++ b/demo-app/src/main/java/cash/z/ecc/android/sdk/demoapp/ui/screen/transactions/view/TransactionsView.kt @@ -31,6 +31,8 @@ import cash.z.ecc.android.sdk.demoapp.R import cash.z.ecc.android.sdk.internal.Twig import cash.z.ecc.android.sdk.model.TransactionOverview import cash.z.ecc.android.sdk.model.WalletAddresses +import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.toList import kotlinx.coroutines.launch @@ -72,6 +74,7 @@ fun Transactions( paddingValues = paddingValues, synchronizer, synchronizer.transactions.collectAsStateWithLifecycle(initialValue = emptyList()).value + .toPersistentList() ) } } @@ -110,7 +113,7 @@ private fun TransactionsTopAppBar( private fun TransactionsMainContent( paddingValues: PaddingValues, synchronizer: Synchronizer, - transactions: List + transactions: ImmutableList ) { val queryScope = rememberCoroutineScope() Column( diff --git a/gradle.properties b/gradle.properties index 2c462c61e..6e0f9e68b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -136,6 +136,7 @@ JAVAX_ANNOTATION_VERSION=1.3.2 JUNIT_VERSION=5.9.3 KOTLINX_COROUTINES_VERSION=1.7.3 KOTLINX_DATETIME_VERSION=0.4.0 +KOTLINX_IMMUTABLE_COLLECTIONS_VERSION=0.3.5 KOTLIN_VERSION=1.9.10 MOCKITO_KOTLIN_VERSION=2.2.0 MOCKITO_VERSION=5.4.0 diff --git a/settings.gradle.kts b/settings.gradle.kts index af1304483..7792523f2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -110,6 +110,7 @@ dependencyResolutionManagement { val kotlinVersion = extra["KOTLIN_VERSION"].toString() val kotlinxCoroutinesVersion = extra["KOTLINX_COROUTINES_VERSION"].toString() val kotlinxDateTimeVersion = extra["KOTLINX_DATETIME_VERSION"].toString() + val kotlinxImmutableCollectionsVersion = extra["KOTLINX_IMMUTABLE_COLLECTIONS_VERSION"].toString() val mockitoKotlinVersion = extra["MOCKITO_KOTLIN_VERSION"].toString() val mockitoVersion = extra["MOCKITO_VERSION"].toString() val protocVersion = extra["PROTOC_VERSION"].toString() @@ -167,6 +168,7 @@ dependencyResolutionManagement { library("kotlinx-coroutines-android", "org.jetbrains.kotlinx:kotlinx-coroutines-android:$kotlinxCoroutinesVersion") library("kotlinx-coroutines-core", "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinxCoroutinesVersion") library("kotlinx-datetime", "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinxDateTimeVersion") + library("kotlinx-immutable", "org.jetbrains.kotlinx:kotlinx-collections-immutable:$kotlinxImmutableCollectionsVersion") library("material", "com.google.android.material:material:$googleMaterialVersion") library("zcashwalletplgn", "com.github.zcash:zcash-android-wallet-plugins:$zcashWalletPluginVersion")