Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add infinite scroll option to homepage #4945

Open
wants to merge 1 commit into
base: 14-dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lawnchair/src/app/lawnchair/LawnchairLauncher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Comment on lines +199 to +203
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code seems incomplete, at the moment(?)

}

override fun collectStateHandlers(out: MutableList<StateManager.StateHandler<*>>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Comment on lines +84 to +86
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string for infinite scroll appeared to be missing

)
}

val navController = LocalNavController.current
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Comment on lines +132 to +133
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string for infinite scroll appeared to be missing.

)
}
}
PreferenceGroup(heading = stringResource(id = R.string.popup_menu)) {
Expand Down
Loading