mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-09 16:11:20 +02:00
Optional to automatically go to new page on focus instead of clicking (#127)
Closes #95 Adds a setting (defaults to enabled) to automatically go to a page when the navigation drawer item is focused after a brief delay. Basically, if you open the left nav drawer, and scroll down to "Movies" after a brief delay (600ms), the app will switch to the Movies page without having to click. It can be disabled in advanced settings.
This commit is contained in:
parent
26cc092402
commit
9f3691fd1b
6 changed files with 137 additions and 17 deletions
|
|
@ -590,13 +590,25 @@ sealed interface AppPreference<T> {
|
|||
getter = { },
|
||||
setter = { prefs, _ -> prefs },
|
||||
)
|
||||
|
||||
val NavDrawerSwitchOnFocus =
|
||||
AppSwitchPreference(
|
||||
title = R.string.nav_drawer_switch_on_focus,
|
||||
defaultValue = true,
|
||||
getter = { it.interfacePreferences.navDrawerSwitchOnFocus },
|
||||
setter = { prefs, value ->
|
||||
prefs.updateInterfacePreferences { navDrawerSwitchOnFocus = value }
|
||||
},
|
||||
summaryOn = R.string.enabled,
|
||||
summaryOff = R.string.nav_drawer_switch_on_focus_summary_off,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val basicPreferences =
|
||||
listOf(
|
||||
PreferenceGroup(
|
||||
title = R.string.basic_interface,
|
||||
title = R.string.ui_interface,
|
||||
preferences =
|
||||
listOf(
|
||||
AppPreference.HomePageItems,
|
||||
|
|
@ -648,6 +660,13 @@ val uiPreferences = listOf<PreferenceGroup>()
|
|||
|
||||
val advancedPreferences =
|
||||
listOf(
|
||||
PreferenceGroup(
|
||||
title = R.string.ui_interface,
|
||||
preferences =
|
||||
listOf(
|
||||
AppPreference.NavDrawerSwitchOnFocus,
|
||||
),
|
||||
),
|
||||
PreferenceGroup(
|
||||
title = R.string.playback,
|
||||
preferences =
|
||||
|
|
|
|||
|
|
@ -70,6 +70,8 @@ class AppPreferencesSerializer
|
|||
.apply {
|
||||
playThemeSongs = AppPreference.PlayThemeMusic.defaultValue
|
||||
appThemeColors = AppPreference.ThemeColors.defaultValue
|
||||
navDrawerSwitchOnFocus =
|
||||
AppPreference.NavDrawerSwitchOnFocus.defaultValue
|
||||
}.build()
|
||||
}.build()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue