diff --git a/build.gradle b/build.gradle index 0527b0873e7..3ac31ca772b 100644 --- a/build.gradle +++ b/build.gradle @@ -318,6 +318,11 @@ androidComponents { } } +composeCompiler { + stabilityConfigurationFile = layout.projectDirectory.file("compose_compiler_config.conf") + reportsDestination = layout.buildDirectory.dir("compose_build_reports") +} + addFrameworkJar('framework-14.jar') dependencies { @@ -360,7 +365,6 @@ dependencies { implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1' implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.2' - implementation "org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.8" implementation 'com.github.ChickenHook:RestrictionBypass:2.2' implementation 'dev.rikka.tools.refine:runtime:4.4.0' diff --git a/compose_compiler_config.conf b/compose_compiler_config.conf new file mode 100644 index 00000000000..5bc2b52b45b --- /dev/null +++ b/compose_compiler_config.conf @@ -0,0 +1,8 @@ +androidx.collection.* + +java.nio.file.Path + +kotlin.collections.* +kotlin.time.Duration + +kotlinx.coroutines.CoroutineScope diff --git a/lawnchair/src/app/lawnchair/smartspace/model/SmartspaceMode.kt b/lawnchair/src/app/lawnchair/smartspace/model/SmartspaceMode.kt index 332a55dcdae..08f1286dde7 100644 --- a/lawnchair/src/app/lawnchair/smartspace/model/SmartspaceMode.kt +++ b/lawnchair/src/app/lawnchair/smartspace/model/SmartspaceMode.kt @@ -6,7 +6,6 @@ import androidx.annotation.LayoutRes import androidx.annotation.StringRes import app.lawnchair.util.isPackageInstalledAndEnabled import com.android.launcher3.R -import kotlinx.collections.immutable.persistentListOf sealed class SmartspaceMode( @StringRes val nameResourceId: Int, @@ -23,7 +22,7 @@ sealed class SmartspaceMode( /** * @return The list of all smartspace options */ - fun values() = persistentListOf( + fun values() = listOf( LawnchairSmartspace, GoogleSmartspace, GoogleSearchSmartspace, diff --git a/lawnchair/src/app/lawnchair/theme/color/ColorMode.kt b/lawnchair/src/app/lawnchair/theme/color/ColorMode.kt index 597dedefcc0..7337be2d7a4 100644 --- a/lawnchair/src/app/lawnchair/theme/color/ColorMode.kt +++ b/lawnchair/src/app/lawnchair/theme/color/ColorMode.kt @@ -4,8 +4,6 @@ import androidx.annotation.StringRes import androidx.compose.ui.res.stringResource import app.lawnchair.ui.preferences.components.controls.ListPreferenceEntry import com.android.launcher3.R -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.toPersistentList enum class ColorMode( @StringRes val labelResourceId: Int, @@ -30,8 +28,8 @@ enum class ColorMode( fun fromString(string: String) = values().firstOrNull { it.toString() == string } - fun entries(): ImmutableList> = values().map { + fun entries(): List> = values().map { ListPreferenceEntry(value = it) { stringResource(id = it.labelResourceId) } - }.toPersistentList() + } } } diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/AnnouncementPreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/AnnouncementPreference.kt index 8c05f177a19..3aadcce5b71 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/AnnouncementPreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/AnnouncementPreference.kt @@ -44,7 +44,6 @@ import app.lawnchair.ui.preferences.data.liveinfo.model.Announcement import app.lawnchair.ui.util.addIf import com.android.launcher3.BuildConfig import com.android.launcher3.R -import kotlinx.collections.immutable.ImmutableList @Composable fun AnnouncementPreference() { @@ -56,14 +55,14 @@ fun AnnouncementPreference() { if (enabled && showAnnouncements) { AnnouncementPreference( - announcements = liveInformation.announcementsImmutable, + announcements = liveInformation.announcements, ) } } @Composable fun AnnouncementPreference( - announcements: ImmutableList, + announcements: List, modifier: Modifier = Modifier, ) { Column( diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/FeedPreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/FeedPreference.kt index b12246d3906..0362f4fe664 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/FeedPreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/FeedPreference.kt @@ -19,7 +19,6 @@ import app.lawnchair.ui.preferences.components.controls.ListPreference import app.lawnchair.ui.preferences.components.controls.ListPreferenceEntry import com.android.launcher3.R import com.google.accompanist.drawablepainter.rememberDrawablePainter -import kotlinx.collections.immutable.toPersistentList data class ProviderInfo( val name: String, @@ -49,7 +48,7 @@ fun getEntries(context: Context) = getProviders(context).map { }, label = { it.name }, ) -}.toPersistentList() +}.toList() @Composable fun FeedPreference( diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/HiddenAppsInSearchPreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/HiddenAppsInSearchPreference.kt index ccb61e1d2b1..01900eb3fb3 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/HiddenAppsInSearchPreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/HiddenAppsInSearchPreference.kt @@ -7,7 +7,6 @@ import app.lawnchair.preferences2.preferenceManager2 import app.lawnchair.ui.preferences.components.controls.ListPreference import app.lawnchair.ui.preferences.components.controls.ListPreferenceEntry import com.android.launcher3.R -import kotlinx.collections.immutable.toPersistentList object HiddenAppsInSearch { const val NEVER = "off" @@ -20,13 +19,12 @@ val hiddenAppsInSearchEntries = sequenceOf( ListPreferenceEntry(HiddenAppsInSearch.IF_NAME_TYPED) { stringResource(R.string.hidden_apps_show_name_typed) }, ListPreferenceEntry(HiddenAppsInSearch.ALWAYS) { stringResource(R.string.always_choice) }, ) - .toPersistentList() @Composable fun HiddenAppsInSearchPreference() { ListPreference( adapter = preferenceManager2().hiddenAppsInSearch.getAdapter(), - entries = hiddenAppsInSearchEntries, + entries = hiddenAppsInSearchEntries.toList(), label = stringResource(R.string.show_hidden_apps_in_search_results), ) } diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/ThemePreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/ThemePreference.kt index 691839054bf..0621c56db77 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/ThemePreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/ThemePreference.kt @@ -8,7 +8,6 @@ import app.lawnchair.ui.preferences.components.controls.ListPreference import app.lawnchair.ui.preferences.components.controls.ListPreferenceEntry import com.android.launcher3.R import com.android.launcher3.Utilities -import kotlinx.collections.immutable.toPersistentList object ThemeChoice { const val LIGHT = "light" @@ -28,7 +27,7 @@ val themeEntries = sequenceOf( ThemeChoice.SYSTEM -> Utilities.ATLEAST_O_MR1 else -> true } - }.toPersistentList() + }.toList() @Composable fun ThemePreference() { diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/WebSearchProvider.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/WebSearchProvider.kt index 424f14d0f4e..e642b60616e 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/WebSearchProvider.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/WebSearchProvider.kt @@ -17,8 +17,6 @@ import app.lawnchair.ui.preferences.components.controls.ListPreferenceEntry import app.lawnchair.ui.preferences.components.layout.Chip import app.lawnchair.ui.preferences.components.layout.PreferenceTemplate import com.android.launcher3.R -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.toPersistentList @Composable fun WebSearchProvider( @@ -31,7 +29,7 @@ fun WebSearchProvider( value = mode, label = { stringResource(id = mode.label) }, ) - }.toPersistentList() + } } ListPreferenceChips( @@ -45,7 +43,7 @@ fun WebSearchProvider( @Composable fun ListPreferenceChips( adapter: PreferenceAdapter, - entries: ImmutableList>, + entries: List>, label: String, modifier: Modifier = Modifier, enabled: Boolean = true, @@ -62,7 +60,7 @@ fun ListPreferenceChips( @Composable fun ListPreferenceChips( - entries: ImmutableList>, + entries: List>, value: T, onValueChange: (T) -> Unit, label: String, diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorOptions.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorOptions.kt index 6f5446979db..7252187e58b 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorOptions.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorOptions.kt @@ -1,10 +1,8 @@ package app.lawnchair.ui.preferences.components.colorpreference import app.lawnchair.theme.color.ColorOption -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.toPersistentList -val staticColors: ImmutableList> = sequenceOf( +val staticColors: List> = sequenceOf( ColorOption.CustomColor(0xFFF32020), ColorOption.CustomColor(0xFFF20D69), ColorOption.CustomColor(0xFF7452FF), @@ -17,13 +15,13 @@ val staticColors: ImmutableList> = sequenceOf( ColorOption.CustomColor(0xFFFF9800), ColorOption.CustomColor(0xFF7C5445), ColorOption.CustomColor(0xFF67818E), -).map(ColorOption::colorPreferenceEntry).toPersistentList() +).map(ColorOption::colorPreferenceEntry).toList() -val dynamicColors: ImmutableList> = +val dynamicColors: List> = sequenceOf(ColorOption.SystemAccent, ColorOption.WallpaperPrimary) .filter(ColorOption::isSupported) .map(ColorOption::colorPreferenceEntry) - .toPersistentList() + .toList() -val dynamicColorsWithDefault: ImmutableList> = - (dynamicColors.asSequence() + ColorOption.Default.colorPreferenceEntry).toPersistentList() +val dynamicColorsWithDefault: List> = + (dynamicColors.asSequence() + ColorOption.Default.colorPreferenceEntry).toList() diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorPreferenceModel.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorPreferenceModel.kt index 1b79445b26c..5173fdce2c1 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorPreferenceModel.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorPreferenceModel.kt @@ -4,10 +4,9 @@ import androidx.annotation.StringRes import androidx.datastore.preferences.core.Preferences import app.lawnchair.theme.color.ColorOption import com.patrykmichalik.opto.domain.Preference -import kotlinx.collections.immutable.ImmutableList data class ColorPreferenceModel( val prefObject: Preference>, @StringRes val labelRes: Int, - val dynamicEntries: ImmutableList>, + val dynamicEntries: List>, ) diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorSelectionPreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorSelectionPreference.kt index cb9847ef73b..f357bef3051 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorSelectionPreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/ColorSelectionPreference.kt @@ -32,7 +32,6 @@ import app.lawnchair.ui.preferences.components.layout.Chip import app.lawnchair.ui.preferences.components.layout.PreferenceLayout import com.android.launcher3.R import com.patrykmichalik.opto.domain.Preference -import kotlinx.collections.immutable.ImmutableList import kotlinx.coroutines.launch @Composable @@ -40,8 +39,8 @@ fun ColorSelection( label: String, preference: Preference, modifier: Modifier = Modifier, - dynamicEntries: ImmutableList> = dynamicColors, - staticEntries: ImmutableList> = staticColors, + dynamicEntries: List> = dynamicColors, + staticEntries: List> = staticColors, ) { val adapter = preference.getAdapter() val appliedColor = adapter.state.value diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/PresetsList.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/PresetsList.kt index d2d0de3621a..9be9af83fa0 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/PresetsList.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/PresetsList.kt @@ -16,11 +16,10 @@ import app.lawnchair.ui.preferences.components.layout.PreferenceDivider import app.lawnchair.ui.preferences.components.layout.PreferenceGroup import app.lawnchair.ui.preferences.components.layout.PreferenceTemplate import com.android.launcher3.R -import kotlinx.collections.immutable.ImmutableList @Composable fun PresetsList( - dynamicEntries: ImmutableList>, + dynamicEntries: List>, onPresetClick: (ColorOption) -> Unit, isPresetSelected: (ColorOption) -> Boolean, modifier: Modifier = Modifier, diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/SwatchGrid.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/SwatchGrid.kt index 5f1501c6dbe..eb58b041e2c 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/SwatchGrid.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/colorpreference/pickers/SwatchGrid.kt @@ -29,7 +29,6 @@ import app.lawnchair.ui.preferences.components.colorpreference.ColorPreferenceEn import app.lawnchair.ui.preferences.components.layout.PreferenceGroup import app.lawnchair.ui.theme.isSelectedThemeDark import com.android.launcher3.R -import kotlinx.collections.immutable.ImmutableList object SwatchGridDefaults { val GutterSize = 12.dp @@ -39,7 +38,7 @@ object SwatchGridDefaults { @Composable fun SwatchGrid( - entries: ImmutableList>, + entries: List>, onSwatchClick: (T) -> Unit, isSwatchSelected: (T) -> Boolean, modifier: Modifier = Modifier, diff --git a/lawnchair/src/app/lawnchair/ui/preferences/components/controls/ListPreference.kt b/lawnchair/src/app/lawnchair/ui/preferences/components/controls/ListPreference.kt index 23907b0d049..59990471315 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/components/controls/ListPreference.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/components/controls/ListPreference.kt @@ -35,12 +35,11 @@ import app.lawnchair.ui.preferences.components.layout.PreferenceDivider import app.lawnchair.ui.preferences.components.layout.PreferenceTemplate import app.lawnchair.ui.util.addIf import app.lawnchair.ui.util.bottomSheetHandler -import kotlinx.collections.immutable.ImmutableList @Composable fun ListPreference( adapter: PreferenceAdapter, - entries: ImmutableList>, + entries: List>, label: String, modifier: Modifier = Modifier, enabled: Boolean = true, @@ -61,7 +60,7 @@ fun ListPreference( @Composable fun ListPreference( - entries: ImmutableList>, + entries: List>, value: T, onValueChange: (T) -> Unit, label: String, diff --git a/lawnchair/src/app/lawnchair/ui/preferences/data/liveinfo/model/LiveInformation.kt b/lawnchair/src/app/lawnchair/ui/preferences/data/liveinfo/model/LiveInformation.kt index cd69edc2230..cd328857e4a 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/data/liveinfo/model/LiveInformation.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/data/liveinfo/model/LiveInformation.kt @@ -1,18 +1,12 @@ package app.lawnchair.ui.preferences.data.liveinfo.model -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.toImmutableList import kotlinx.serialization.Serializable @Serializable data class LiveInformation( private val version: Int = 1, - private val announcements: List, + val announcements: List, ) { - - val announcementsImmutable: ImmutableList - get() = announcements.toImmutableList() - companion object { val default = LiveInformation( version = 1, diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/DockPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/DockPreferences.kt index af7d5399428..3bd089199df 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/DockPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/DockPreferences.kt @@ -41,7 +41,6 @@ import app.lawnchair.ui.preferences.components.layout.ExpandAndShrink import app.lawnchair.ui.preferences.components.layout.PreferenceGroup import app.lawnchair.ui.preferences.components.layout.PreferenceLayout import com.android.launcher3.R -import kotlinx.collections.immutable.toPersistentList object DockRoutes { const val SEARCH_PROVIDER = "searchProvider" @@ -143,7 +142,7 @@ private fun HotseatModePreference( label = { stringResource(id = mode.nameResourceId) }, enabled = mode.isAvailable(context = context), ) - }.toPersistentList() + } } ListPreference( diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/GeneralPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/GeneralPreferences.kt index bc132138fec..05e909cbb35 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/GeneralPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/GeneralPreferences.kt @@ -51,7 +51,6 @@ import app.lawnchair.ui.preferences.components.notificationDotsEnabled import app.lawnchair.ui.preferences.components.notificationServiceEnabled import com.android.launcher3.R import com.android.launcher3.Utilities -import kotlinx.collections.immutable.toPersistentList object GeneralRoutes { const val ICON_PACK = "iconPack" @@ -220,7 +219,7 @@ private fun ColorStylePreference( value = mode, label = { stringResource(id = mode.nameResourceId) }, ) - }.toPersistentList() + } } ListPreference( diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/HiddenAppsPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/HiddenAppsPreferences.kt index 24ef2f153d2..ec87de87bfc 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/HiddenAppsPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/HiddenAppsPreferences.kt @@ -40,8 +40,6 @@ import app.lawnchair.util.appComparator import app.lawnchair.util.appsState import com.android.launcher3.R import java.util.Comparator.comparing -import kotlinx.collections.immutable.ImmutableSet -import kotlinx.collections.immutable.toPersistentSet @Composable fun HiddenAppsPreferences( @@ -55,7 +53,7 @@ fun HiddenAppsPreferences( } else { stringResource(id = R.string.hidden_apps_label_with_count, hiddenApps.size) } - val apps by appsState(comparator = hiddenAppsComparator(hiddenApps.toPersistentSet())) + val apps by appsState(comparator = hiddenAppsComparator(hiddenApps)) val state = rememberLazyListState() PreferenceScaffold( label = pageTitle, @@ -109,7 +107,7 @@ fun HiddenAppsPreferences( } @Composable -fun hiddenAppsComparator(hiddenApps: ImmutableSet): Comparator = remember { +fun hiddenAppsComparator(hiddenApps: Set): Comparator = remember { comparing { if (hiddenApps.contains(it.key.toString())) 0 else 1 }.then(appComparator) diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconPackPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconPackPreferences.kt index 043b5ff9690..880998bdc1d 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconPackPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/IconPackPreferences.kt @@ -79,7 +79,6 @@ import app.lawnchair.util.getThemedIconPacksInstalled import app.lawnchair.util.isPackageInstalled import com.android.launcher3.R import com.google.accompanist.drawablepainter.rememberDrawablePainter -import kotlinx.collections.immutable.toPersistentList import kotlinx.coroutines.launch data class IconPackInfo( @@ -227,7 +226,7 @@ fun IconPackPreferences( value = it, label = { stringResource(id = it.labelResourceId) }, ) - }.toPersistentList(), + }, value = ThemedIconsState.getForSettings( themedIcons = themedIconsAdapter.state.value, drawerThemedIcons = drawerThemedIconsEnabled, diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/SearchPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/SearchPreferences.kt index 013ea227af3..812e6375169 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/SearchPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/SearchPreferences.kt @@ -37,7 +37,6 @@ import app.lawnchair.util.filesAndStorageGranted import com.android.launcher3.R import com.google.accompanist.permissions.ExperimentalPermissionsApi import com.google.accompanist.permissions.rememberPermissionState -import kotlinx.collections.immutable.toPersistentList @Composable fun SearchPreferences() { @@ -138,16 +137,18 @@ private fun ASISearchSettings(prefs: PreferenceManager) { private fun SearchProvider( context: Context, ) { - val searchAlgorithmEntries = sequenceOf( - ListPreferenceEntry(LawnchairSearchAlgorithm.APP_SEARCH) { stringResource(R.string.search_algorithm_app_search) }, - ListPreferenceEntry(LawnchairSearchAlgorithm.LOCAL_SEARCH) { stringResource(R.string.search_algorithm_global_search_on_device) }, - ListPreferenceEntry(LawnchairSearchAlgorithm.ASI_SEARCH) { stringResource(R.string.search_algorithm_global_search_via_asi) }, - ).filter { - when (it.value) { - LawnchairSearchAlgorithm.ASI_SEARCH -> LawnchairSearchAlgorithm.isASISearchEnabled(context) - else -> true - } - }.toPersistentList() + val searchAlgorithmEntries = remember { + sequenceOf( + ListPreferenceEntry(LawnchairSearchAlgorithm.APP_SEARCH) { stringResource(R.string.search_algorithm_app_search) }, + ListPreferenceEntry(LawnchairSearchAlgorithm.LOCAL_SEARCH) { stringResource(R.string.search_algorithm_global_search_on_device) }, + ListPreferenceEntry(LawnchairSearchAlgorithm.ASI_SEARCH) { stringResource(R.string.search_algorithm_global_search_via_asi) }, + ).filter { + when (it.value) { + LawnchairSearchAlgorithm.ASI_SEARCH -> LawnchairSearchAlgorithm.isASISearchEnabled(context) + else -> true + } + }.toList() + } ListPreference( adapter = preferenceManager2().searchAlgorithm.getAdapter(), diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/SmartspacePreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/SmartspacePreferences.kt index 69f3ff37290..bba44fd3070 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/SmartspacePreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/SmartspacePreferences.kt @@ -41,7 +41,6 @@ import app.lawnchair.ui.preferences.components.layout.PreferenceLayout import app.lawnchair.ui.theme.isSelectedThemeDark import com.android.launcher3.R import com.kieronquinn.app.smartspacer.sdk.SmartspacerConstants -import kotlinx.collections.immutable.toPersistentList @Composable fun SmartspacePreferences( @@ -136,7 +135,7 @@ fun SmartspaceProviderPreference( label = { stringResource(id = mode.nameResourceId) }, enabled = mode.isAvailable(context = context), ) - }.toPersistentList() + }.toList() } ListPreference( @@ -244,7 +243,7 @@ fun SmartspaceTimeFormatPreference( ListPreference( adapter = adapter, - entries = entries.toPersistentList(), + entries = entries, label = stringResource(id = R.string.smartspace_time_format), modifier = modifier, ) @@ -257,7 +256,7 @@ fun SmartspaceCalendarPreference( val entries = remember { SmartspaceCalendar.values().map { calendar -> ListPreferenceEntry(calendar) { stringResource(id = calendar.nameResourceId) } - }.toPersistentList() + } } val adapter = preferenceManager2().smartspaceCalendar.getAdapter()