diff --git a/lawnchair/src/app/lawnchair/LawnchairLauncher.kt b/lawnchair/src/app/lawnchair/LawnchairLauncher.kt index 9c300456605..0d8fc5f2a47 100644 --- a/lawnchair/src/app/lawnchair/LawnchairLauncher.kt +++ b/lawnchair/src/app/lawnchair/LawnchairLauncher.kt @@ -195,6 +195,12 @@ class LawnchairLauncher : QuickstepLauncher() { showQuickstepWarningIfNecessary() reloadIconsIfNeeded() + + // Observe the infiniteScroll preference and update the launcher accordingly + prefs.infiniteScroll.subscribeChanges(this) { infiniteScrollEnabled -> + // Add logic to handle infinite scroll based on the new preference + // For example, update the workspace or other relevant components + } } override fun collectStateHandlers(out: MutableList>) { diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenGridPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenGridPreferences.kt index 21f15a9036c..4ea77d94c4d 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenGridPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenGridPreferences.kt @@ -25,6 +25,7 @@ import app.lawnchair.preferences.preferenceManager import app.lawnchair.ui.preferences.LocalNavController import app.lawnchair.ui.preferences.components.GridOverridesPreview import app.lawnchair.ui.preferences.components.controls.SliderPreference +import app.lawnchair.ui.preferences.components.controls.SwitchPreference import app.lawnchair.ui.preferences.components.layout.PreferenceGroup import app.lawnchair.ui.preferences.components.layout.PreferenceLayout import com.android.launcher3.LauncherAppState @@ -79,6 +80,11 @@ fun HomeScreenGridPreferences( step = 1, valueRange = 3..maxGridSize, ) + SwitchPreference( + adapter = prefs.infiniteScroll.getAdapter(), + label = stringResource(id = R.string.infinite_scroll_label), + description = stringResource(id = R.string.infinite_scroll_description), + ) } val navController = LocalNavController.current diff --git a/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenPreferences.kt b/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenPreferences.kt index 9c7b3a68020..5b552f975f1 100644 --- a/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenPreferences.kt +++ b/lawnchair/src/app/lawnchair/ui/preferences/destinations/HomeScreenPreferences.kt @@ -127,6 +127,11 @@ fun HomeScreenPreferences( label = stringResource(id = R.string.show_dot_pagination_label), description = stringResource(id = R.string.show_dot_pagination_description), ) + SwitchPreference( + adapter = prefs.infiniteScroll.getAdapter(), + label = stringResource(id = R.string.infinite_scroll_label), + description = stringResource(id = R.string.infinite_scroll_description), + ) } } PreferenceGroup(heading = stringResource(id = R.string.popup_menu)) {