diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt index 2c46bf2419..563699b965 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutState.kt @@ -7,6 +7,8 @@ package io.element.android.features.preferences.impl.about +import kotlinx.collections.immutable.ImmutableList + data class AboutState( - val elementLegals: List, + val elementLegals: ImmutableList, ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt index 6d6a4813df..34cbd0b54e 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/AboutStateProvider.kt @@ -8,6 +8,7 @@ package io.element.android.features.preferences.impl.about import androidx.compose.ui.tooling.preview.PreviewParameterProvider +import kotlinx.collections.immutable.toImmutableList open class AboutStateProvider : PreviewParameterProvider { override val values: Sequence @@ -19,5 +20,5 @@ open class AboutStateProvider : PreviewParameterProvider { fun anAboutState( elementLegals: List = getAllLegals(), ) = AboutState( - elementLegals = elementLegals, + elementLegals = elementLegals.toImmutableList(), ) diff --git a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt index a5de31f05d..d9aa7aea65 100644 --- a/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt +++ b/features/preferences/impl/src/main/kotlin/io/element/android/features/preferences/impl/about/ElementLegal.kt @@ -10,6 +10,8 @@ package io.element.android.features.preferences.impl.about import androidx.annotation.StringRes import io.element.android.features.preferences.impl.BuildConfig import io.element.android.libraries.ui.strings.CommonStrings +import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.persistentListOf private const val COPYRIGHT_URL = BuildConfig.URL_COPYRIGHT private const val USE_POLICY_URL = BuildConfig.URL_ACCEPTABLE_USE @@ -24,8 +26,8 @@ sealed class ElementLegal( data object PrivacyPolicy : ElementLegal(CommonStrings.common_privacy_policy, PRIVACY_URL) } -fun getAllLegals(): List { - return listOf( +fun getAllLegals(): ImmutableList { + return persistentListOf( ElementLegal.Copyright, ElementLegal.AcceptableUsePolicy, ElementLegal.PrivacyPolicy,