diff --git a/screen/accounts/src/main/java/com/ivy/accounts/AccountsViewModel.kt b/screen/accounts/src/main/java/com/ivy/accounts/AccountsViewModel.kt index 252d58c2e2..c3e7ac8d0e 100644 --- a/screen/accounts/src/main/java/com/ivy/accounts/AccountsViewModel.kt +++ b/screen/accounts/src/main/java/com/ivy/accounts/AccountsViewModel.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.data.db.dao.write.WriteAccountDao @@ -30,6 +31,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @SuppressLint("StaticFieldLeak") @HiltViewModel class AccountsViewModel @Inject constructor( diff --git a/screen/attributions/src/main/java/com/ivy/attributions/AttributionsViewModel.kt b/screen/attributions/src/main/java/com/ivy/attributions/AttributionsViewModel.kt index 4cacf2120d..5039c453ec 100644 --- a/screen/attributions/src/main/java/com/ivy/attributions/AttributionsViewModel.kt +++ b/screen/attributions/src/main/java/com/ivy/attributions/AttributionsViewModel.kt @@ -1,10 +1,12 @@ package com.ivy.attributions import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import com.ivy.domain.ComposeViewModel import dagger.hilt.android.lifecycle.HiltViewModel import javax.inject.Inject +@Stable @HiltViewModel class AttributionsViewModel @Inject constructor( private val attributionsProvider: AttributionsProvider diff --git a/screen/balance/src/main/java/com/ivy/balance/BalanceViewModel.kt b/screen/balance/src/main/java/com/ivy/balance/BalanceViewModel.kt index 9c88dd67a6..0781c7322c 100644 --- a/screen/balance/src/main/java/com/ivy/balance/BalanceViewModel.kt +++ b/screen/balance/src/main/java/com/ivy/balance/BalanceViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.balance import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf @@ -16,6 +17,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class BalanceViewModel @Inject constructor( private val plannedPaymentsLogic: PlannedPaymentsLogic, diff --git a/screen/budgets/src/main/java/com/ivy/budgets/BudgetViewModel.kt b/screen/budgets/src/main/java/com/ivy/budgets/BudgetViewModel.kt index 455d2e3246..7ea9bf97b5 100644 --- a/screen/budgets/src/main/java/com/ivy/budgets/BudgetViewModel.kt +++ b/screen/budgets/src/main/java/com/ivy/budgets/BudgetViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.budgets import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -35,6 +36,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class BudgetViewModel @Inject constructor( private val sharedPrefs: SharedPrefs, diff --git a/screen/categories/src/main/java/com/ivy/categories/CategoriesScreen.kt b/screen/categories/src/main/java/com/ivy/categories/CategoriesScreen.kt index ad30aab6a6..1d64113d59 100644 --- a/screen/categories/src/main/java/com/ivy/categories/CategoriesScreen.kt +++ b/screen/categories/src/main/java/com/ivy/categories/CategoriesScreen.kt @@ -69,6 +69,7 @@ import com.ivy.wallet.ui.theme.modal.edit.CategoryModal import com.ivy.wallet.ui.theme.modal.edit.CategoryModalData import com.ivy.wallet.ui.theme.toComposeColor import com.ivy.wallet.ui.theme.wallet.AmountCurrencyB1 +import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf import java.util.UUID @@ -415,7 +416,7 @@ private fun CategoryHeader( @Suppress("UnusedParameter") @Composable fun BoxWithConstraintsScope.SortModal( - items: List, + items: ImmutableList, visible: Boolean, initialType: SortOrder, dismiss: () -> Unit, diff --git a/screen/categories/src/main/java/com/ivy/categories/CategoriesViewModel.kt b/screen/categories/src/main/java/com/ivy/categories/CategoriesViewModel.kt index 51fda3d7d5..552da7d208 100644 --- a/screen/categories/src/main/java/com/ivy/categories/CategoriesViewModel.kt +++ b/screen/categories/src/main/java/com/ivy/categories/CategoriesViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.categories import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.base.legacy.Transaction @@ -31,6 +32,7 @@ import kotlinx.coroutines.awaitAll import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class CategoriesViewModel @Inject constructor( private val categoryCreator: CategoryCreator, diff --git a/screen/contributors/src/main/java/com/ivy/contributors/ContributorsViewModel.kt b/screen/contributors/src/main/java/com/ivy/contributors/ContributorsViewModel.kt index a0d3720e37..6eeb1cec56 100644 --- a/screen/contributors/src/main/java/com/ivy/contributors/ContributorsViewModel.kt +++ b/screen/contributors/src/main/java/com/ivy/contributors/ContributorsViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.contributors import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.domain.ComposeViewModel @@ -10,6 +11,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class ContributorsViewModel @Inject constructor( private val ivyWalletRepositoryDataSource: IvyWalletRepositoryDataSource diff --git a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt index 0e6e580859..73c785dbe2 100644 --- a/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt +++ b/screen/edit-transaction/src/main/java/com/ivy/transaction/EditTransactionViewModel.kt @@ -1,6 +1,7 @@ package com.ivy.transaction import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -58,6 +59,7 @@ import java.time.LocalTime import java.util.UUID import javax.inject.Inject +@Stable @HiltViewModel class EditTransactionViewModel @Inject constructor( private val loanDao: LoanDao, diff --git a/screen/exchange-rates/src/main/java/com/ivy/exchangerates/ExchangeRatesViewModel.kt b/screen/exchange-rates/src/main/java/com/ivy/exchangerates/ExchangeRatesViewModel.kt index 76a9e89add..8c8355b1a3 100644 --- a/screen/exchange-rates/src/main/java/com/ivy/exchangerates/ExchangeRatesViewModel.kt +++ b/screen/exchange-rates/src/main/java/com/ivy/exchangerates/ExchangeRatesViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.exchangerates import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.data.db.dao.read.ExchangeRatesDao @@ -22,6 +23,7 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import javax.inject.Inject +@Stable @HiltViewModel class ExchangeRatesViewModel @Inject constructor( private val exchangeRatesDao: ExchangeRatesDao, diff --git a/screen/features/src/main/java/com/ivy/features/FeaturesViewModel.kt b/screen/features/src/main/java/com/ivy/features/FeaturesViewModel.kt index 909fad9a70..088004c966 100644 --- a/screen/features/src/main/java/com/ivy/features/FeaturesViewModel.kt +++ b/screen/features/src/main/java/com/ivy/features/FeaturesViewModel.kt @@ -3,6 +3,7 @@ package com.ivy.features import android.annotation.SuppressLint import android.content.Context import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.lifecycle.viewModelScope import com.ivy.domain.ComposeViewModel import com.ivy.domain.features.Features @@ -14,6 +15,7 @@ import kotlinx.coroutines.flow.first import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @SuppressLint("StaticFieldLeak") @HiltViewModel class FeaturesViewModel @Inject constructor( diff --git a/screen/home/src/main/java/com/ivy/home/HomeViewModel.kt b/screen/home/src/main/java/com/ivy/home/HomeViewModel.kt index 93baec987b..6cd77663a3 100644 --- a/screen/home/src/main/java/com/ivy/home/HomeViewModel.kt +++ b/screen/home/src/main/java/com/ivy/home/HomeViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.home import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.base.legacy.Theme @@ -56,6 +57,7 @@ import kotlinx.coroutines.launch import java.math.BigDecimal import javax.inject.Inject +@Stable @HiltViewModel class HomeViewModel @Inject constructor( private val ivyContext: IvyWalletCtx, diff --git a/screen/loans/src/main/java/com/ivy/loans/loan/LoanViewModel.kt b/screen/loans/src/main/java/com/ivy/loans/loan/LoanViewModel.kt index ce35787af0..766fead024 100644 --- a/screen/loans/src/main/java/com/ivy/loans/loan/LoanViewModel.kt +++ b/screen/loans/src/main/java/com/ivy/loans/loan/LoanViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.loans.loan import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.base.legacy.SharedPrefs @@ -37,6 +38,7 @@ import kotlinx.coroutines.launch import java.util.UUID import javax.inject.Inject +@Stable @HiltViewModel class LoanViewModel @Inject constructor( private val loanRecordDao: LoanRecordDao, diff --git a/screen/loans/src/main/java/com/ivy/loans/loandetails/LoanDetailsViewModel.kt b/screen/loans/src/main/java/com/ivy/loans/loandetails/LoanDetailsViewModel.kt index 57d7a5caf0..8d63d5baca 100644 --- a/screen/loans/src/main/java/com/ivy/loans/loandetails/LoanDetailsViewModel.kt +++ b/screen/loans/src/main/java/com/ivy/loans/loandetails/LoanDetailsViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.loans.loandetails import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -49,6 +50,7 @@ import kotlinx.coroutines.launch import java.util.UUID import javax.inject.Inject +@Stable @HiltViewModel class LoanDetailsViewModel @Inject constructor( private val loanDao: LoanDao, diff --git a/screen/onboarding/src/main/java/com/ivy/onboarding/viewmodel/OnboardingViewModel.kt b/screen/onboarding/src/main/java/com/ivy/onboarding/viewmodel/OnboardingViewModel.kt index 5c315fef00..8b163a8f19 100644 --- a/screen/onboarding/src/main/java/com/ivy/onboarding/viewmodel/OnboardingViewModel.kt +++ b/screen/onboarding/src/main/java/com/ivy/onboarding/viewmodel/OnboardingViewModel.kt @@ -1,6 +1,7 @@ package com.ivy.onboarding.viewmodel import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.runtime.State import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -43,6 +44,7 @@ import kotlinx.coroutines.launch import timber.log.Timber import javax.inject.Inject +@Stable @HiltViewModel class OnboardingViewModel @Inject constructor( private val ivyContext: IvyWalletCtx, diff --git a/screen/piechart/src/main/java/com/ivy/piechart/PieChart.kt b/screen/piechart/src/main/java/com/ivy/piechart/PieChart.kt index 546d908228..0e8c4c45e4 100644 --- a/screen/piechart/src/main/java/com/ivy/piechart/PieChart.kt +++ b/screen/piechart/src/main/java/com/ivy/piechart/PieChart.kt @@ -28,6 +28,8 @@ import com.ivy.legacy.utils.timeNowUTC import com.ivy.resources.R import com.ivy.wallet.ui.theme.* import com.ivy.wallet.ui.theme.components.IvyIcon +import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.persistentListOf import timber.log.Timber import kotlin.math.acos import kotlin.math.sqrt @@ -38,7 +40,7 @@ const val RADIUS_DP = 112f @Composable fun PieChart( type: TransactionType, - categoryAmounts: List, + categoryAmounts: ImmutableList, selectedCategory: SelectedCategory?, modifier: Modifier = Modifier, onCategoryClicked: (Category?) -> Unit = {} @@ -270,7 +272,7 @@ private fun Preview() { PieChart( type = TransactionType.EXPENSE, - categoryAmounts = listOf( + categoryAmounts = persistentListOf( CategoryAmount( category = Category("Bills", Green.toArgb()), amount = 791.0 diff --git a/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticViewModel.kt b/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticViewModel.kt index 5243e84f2d..9b023b262c 100644 --- a/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticViewModel.kt +++ b/screen/piechart/src/main/java/com/ivy/piechart/PieChartStatisticViewModel.kt @@ -1,6 +1,7 @@ package com.ivy.piechart import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -25,6 +26,7 @@ import kotlinx.coroutines.launch import java.util.UUID import javax.inject.Inject +@Stable @HiltViewModel class PieChartStatisticViewModel @Inject constructor( private val settingsDao: SettingsDao, diff --git a/screen/planned-payments/src/main/java/com/ivy/planned/edit/EditPlannedViewModel.kt b/screen/planned-payments/src/main/java/com/ivy/planned/edit/EditPlannedViewModel.kt index 4108863971..337666b0ad 100644 --- a/screen/planned-payments/src/main/java/com/ivy/planned/edit/EditPlannedViewModel.kt +++ b/screen/planned-payments/src/main/java/com/ivy/planned/edit/EditPlannedViewModel.kt @@ -1,6 +1,7 @@ package com.ivy.planned.edit import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -39,6 +40,7 @@ import kotlinx.coroutines.launch import java.time.LocalDateTime import javax.inject.Inject +@Stable @HiltViewModel class EditPlannedViewModel @Inject constructor( private val accountDao: AccountDao, diff --git a/screen/planned-payments/src/main/java/com/ivy/planned/list/PlannedPaymentsViewModel.kt b/screen/planned-payments/src/main/java/com/ivy/planned/list/PlannedPaymentsViewModel.kt index a7e366daeb..00bc7361d1 100644 --- a/screen/planned-payments/src/main/java/com/ivy/planned/list/PlannedPaymentsViewModel.kt +++ b/screen/planned-payments/src/main/java/com/ivy/planned/list/PlannedPaymentsViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.planned.list import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -21,6 +22,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class PlannedPaymentsViewModel @Inject constructor( private val settingsDao: SettingsDao, diff --git a/screen/releases/src/main/java/com/ivy/releases/ReleasesViewModel.kt b/screen/releases/src/main/java/com/ivy/releases/ReleasesViewModel.kt index a46bc83628..b0698e29ea 100644 --- a/screen/releases/src/main/java/com/ivy/releases/ReleasesViewModel.kt +++ b/screen/releases/src/main/java/com/ivy/releases/ReleasesViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.releases import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.domain.ComposeViewModel @@ -10,6 +11,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class ReleasesViewModel @Inject constructor( private val releasesDataSource: ReleasesDataSource, diff --git a/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt b/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt index cb42894543..bf4c526764 100644 --- a/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt +++ b/screen/reports/src/main/java/com/ivy/reports/ReportViewModel.kt @@ -3,6 +3,7 @@ package com.ivy.reports import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.graphics.toArgb @@ -49,6 +50,7 @@ import java.math.BigDecimal import java.util.UUID import javax.inject.Inject +@Stable @HiltViewModel class ReportViewModel @Inject constructor( private val plannedPaymentsLogic: PlannedPaymentsLogic, diff --git a/screen/search/src/main/java/com/ivy/search/SearchViewModel.kt b/screen/search/src/main/java/com/ivy/search/SearchViewModel.kt index 524687502e..f7ea79df9f 100644 --- a/screen/search/src/main/java/com/ivy/search/SearchViewModel.kt +++ b/screen/search/src/main/java/com/ivy/search/SearchViewModel.kt @@ -2,6 +2,7 @@ package com.ivy.search import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope import com.ivy.base.legacy.TransactionHistoryItem @@ -22,6 +23,7 @@ import kotlinx.collections.immutable.toImmutableList import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @HiltViewModel class SearchViewModel @Inject constructor( private val trnsWithDateDivsAct: TrnsWithDateDivsAct, diff --git a/screen/settings/src/main/java/com/ivy/settings/SettingsViewModel.kt b/screen/settings/src/main/java/com/ivy/settings/SettingsViewModel.kt index b6796318a7..b74935f566 100644 --- a/screen/settings/src/main/java/com/ivy/settings/SettingsViewModel.kt +++ b/screen/settings/src/main/java/com/ivy/settings/SettingsViewModel.kt @@ -4,6 +4,7 @@ import android.annotation.SuppressLint import android.content.Context import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableStateOf import androidx.lifecycle.viewModelScope @@ -35,6 +36,7 @@ import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import javax.inject.Inject +@Stable @SuppressLint("StaticFieldLeak") @HiltViewModel class SettingsViewModel @Inject constructor( diff --git a/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt b/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt index 7cfda4aaa4..36e53d54c6 100644 --- a/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt +++ b/screen/transactions/src/main/java/com/ivy/transactions/TransactionsViewModel.kt @@ -1,6 +1,7 @@ package com.ivy.transactions import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.compose.runtime.mutableDoubleStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.ui.graphics.toArgb @@ -59,6 +60,7 @@ import kotlinx.coroutines.launch import java.util.UUID import javax.inject.Inject +@Stable @HiltViewModel class TransactionsViewModel @Inject constructor( private val accountDao: AccountDao, diff --git a/shared/domain/src/main/java/com/ivy/domain/ComposeViewModel.kt b/shared/domain/src/main/java/com/ivy/domain/ComposeViewModel.kt index b2187cfaae..138096224a 100644 --- a/shared/domain/src/main/java/com/ivy/domain/ComposeViewModel.kt +++ b/shared/domain/src/main/java/com/ivy/domain/ComposeViewModel.kt @@ -1,11 +1,13 @@ package com.ivy.domain import androidx.compose.runtime.Composable +import androidx.compose.runtime.Stable import androidx.lifecycle.ViewModel /** * A simple base ViewModel utilizing Compose' reactivity. */ +@Stable abstract class ComposeViewModel : ViewModel() { /** * Optimized for Compose ui state. diff --git a/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/ChooseIconModal.kt b/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/ChooseIconModal.kt index 68ac1a72b3..164afcf7b8 100644 --- a/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/ChooseIconModal.kt +++ b/temp/legacy-code/src/main/java/com/ivy/legacy/legacy/ui/theme/modal/ChooseIconModal.kt @@ -41,6 +41,8 @@ import com.ivy.resources.R import com.ivy.wallet.ui.theme.Ivy import com.ivy.wallet.ui.theme.components.ItemIconS import com.ivy.wallet.ui.theme.dynamicContrast +import kotlinx.collections.immutable.ImmutableList +import kotlinx.collections.immutable.toImmutableList import java.util.UUID @Deprecated("Old design system. Use `:ivy-design` and Material3") @@ -219,6 +221,8 @@ private fun LazyListScope.addIconsRowIfNotEmpty( onIconSelected: (String) -> Unit ) { + val rowAcc = rowAcc.toImmutableList() + if (rowAcc.isNotEmpty()) { item { IconsRow( @@ -236,7 +240,7 @@ private fun LazyListScope.addIconsRowIfNotEmpty( @Composable private fun IconsRow( - icons: List, + icons: ImmutableList, selectedIcon: String?, color: Color,