mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-24 23:36:04 +00:00
feat(home): choose the page the Home button opens (#2493)
* feat(home): choose the page the Home button opens As the Home app, DroidDeck always came back to whichever page was last open, and a cold start landed on Steam. A new choice under Setup > Launcher, shown while "Use as Home screen" is on, lets Home open the Android apps page instead. The default stays Steam, which keeps the current behaviour. * fix(home): a Home request for the apps page closes a page open over the rail
This commit is contained in:
1 parent
bd022f04be
commit
52bf19ad8e
7 files changed
+62
No files matched your search
@@ -171,6 +171,7 @@ class FrontEndState(
|
||||
val showPhantomGate: Boolean = false,
|
||||
val orientation: Int = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE,
|
||||
val launcherOrientation: Int = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER,
|
||||
val homePage: String = com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_STEAM,
|
||||
val launcherFullscreen: Boolean = true,
|
||||
val downloadSource: String = DownloadSource.MODE_AUTO,
|
||||
val downloadMirror: String = "",
|
||||
@@ -271,6 +272,7 @@ class FrontEndActions(
|
||||
val onLauncherIcon: (String) -> Unit = {},
|
||||
val onOrientation: (Int) -> Unit = {},
|
||||
val onLauncherOrientation: (Int) -> Unit = {},
|
||||
val onHomePage: (String) -> Unit = {},
|
||||
val onLauncherFullscreen: (Boolean) -> Unit = {},
|
||||
val onAnimationsEnabled: (Boolean) -> Unit = {},
|
||||
val onLowStorageWarning: (Boolean) -> Unit = {},
|
||||
@@ -466,6 +468,14 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
"setup:launcher" -> { SetupTabs.openLauncher = true; selected = "setup" }
|
||||
com.droiddeck.launcher.sync.SyncthingService.NAV -> com.droiddeck.launcher.sync.Syncthing.requestOpen()
|
||||
"setup:integration" -> { SetupTabs.openOverview = true; selected = "setup" }
|
||||
com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_APPS -> {
|
||||
// Home lands on the apps page itself, so a page open over the rail (Components, Performance) closes first.
|
||||
if (s.pageKey != null) a.onPageBack()
|
||||
Hops.origin = null
|
||||
Hops.restore = null
|
||||
Hops.sinking = null
|
||||
selected = target
|
||||
}
|
||||
else -> selected = target
|
||||
}
|
||||
a.onNavigated()
|
||||
|
||||
@@ -473,6 +473,11 @@ internal fun SetupPanel(
|
||||
) { a.onHomeScreen(it) }
|
||||
if (s.homeScreenEnabled) {
|
||||
ActionRow(stringResource(R.string.setup_default_home), s.defaultHomeLabel ?: stringResource(R.string.setup_choose_home), stringResource(R.string.setup_choose), a.onHomeApp)
|
||||
ChoiceRow(
|
||||
host, "home-page", stringResource(R.string.setup_home_page), stringResource(R.string.setup_home_page_hint),
|
||||
com.droiddeck.launcher.core.AppUiPrefs.homePageOptions.map { (value, label) -> value to stringResource(label) },
|
||||
s.homePage, onPick = a.onHomePage,
|
||||
)
|
||||
}
|
||||
ChoiceRow(
|
||||
host, "launcher-orientation", stringResource(R.string.setup_launcher_orientation), null,
|
||||
|
||||
Reference in new issue
Block a user