Move deck layout mode to experimental features

Fixes #5563

Around 30 minutes of work.
This commit is contained in:
SuperDragonXD
2025-07-12 11:19:24 +08:00
parent 17113f0f1a
commit 523a15b8ab
4 changed files with 17 additions and 1 deletions

View File

@@ -184,6 +184,9 @@
<string name="icon_swipe_gestures">Icon swipe gestures</string>
<string name="icon_swipe_gestures_description">Perform actions when swiping left or right on icons instead of moving the home screen</string>
<string name="show_deck_layout">Deck layout</string>
<string name="show_deck_layout_description">Show a layout option to hide the app drawer and automatically add new apps to the home screen</string>
<string name="recents_lock_unlock">Lock/unlock</string>
<string name="recents_lock_unlock_description">Prevent selected app from closing when pressing \"Clear all\"</string>

View File

@@ -679,6 +679,11 @@ class PreferenceManager2 private constructor(private val context: Context) :
onSet = { reloadHelper.reloadIcons() },
)
val showDeckLayout = preference(
key = booleanPreferencesKey(name = "show_deck_layout"),
defaultValue = false,
)
val enableLabelInDock = preference(
key = booleanPreferencesKey(name = "enable_label_dock"),
defaultValue = false,

View File

@@ -51,6 +51,11 @@ fun ExperimentalFeaturesPreferences(
label = stringResource(R.string.icon_swipe_gestures),
description = stringResource(R.string.icon_swipe_gestures_description),
)
SwitchPreference(
adapter = prefs2.showDeckLayout.getAdapter(),
label = stringResource(R.string.show_deck_layout),
description = stringResource(R.string.show_deck_layout_description),
)
val enableWallpaperBlur = prefs.enableWallpaperBlur.getAdapter()

View File

@@ -67,8 +67,11 @@ fun HomeScreenPreferences(
modifier = modifier,
) {
val lockHomeScreenAdapter = prefs2.lockHomeScreen.getAdapter()
val showDeckLayout = prefs2.showDeckLayout.getAdapter().state.value
HomeLayoutSettings()
if (showDeckLayout) {
HomeLayoutSettings()
}
PreferenceGroup(heading = stringResource(id = R.string.general_label)) {
val addIconToHomeAdapter = prefs.addIconToHome.getAdapter()