mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 21:11:52 +01:00
More preference grouping
This commit is contained in:
parent
bf8268adc4
commit
3a62acc54d
@ -27,6 +27,30 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||||
titleRes = R.string.pref_category_general
|
titleRes = R.string.pref_category_general
|
||||||
|
|
||||||
|
intListPreference {
|
||||||
|
key = Keys.startScreen
|
||||||
|
titleRes = R.string.pref_start_screen
|
||||||
|
entriesRes = arrayOf(R.string.label_library, R.string.label_recent_manga,
|
||||||
|
R.string.label_recent_updates)
|
||||||
|
entryValues = arrayOf("1", "2", "3")
|
||||||
|
defaultValue = "1"
|
||||||
|
summary = "%s"
|
||||||
|
}
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
|
preference {
|
||||||
|
titleRes = R.string.pref_manage_notifications
|
||||||
|
onClick {
|
||||||
|
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
|
||||||
|
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
|
||||||
|
}
|
||||||
|
startActivity(intent)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
preferenceCategory {
|
||||||
|
titleRes = R.string.pref_category_display
|
||||||
|
|
||||||
listPreference {
|
listPreference {
|
||||||
key = Keys.lang
|
key = Keys.lang
|
||||||
titleRes = R.string.pref_language
|
titleRes = R.string.pref_language
|
||||||
@ -119,25 +143,6 @@ class SettingsGeneralController : SettingsController() {
|
|||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
intListPreference {
|
|
||||||
key = Keys.startScreen
|
|
||||||
titleRes = R.string.pref_start_screen
|
|
||||||
entriesRes = arrayOf(R.string.label_library, R.string.label_recent_manga,
|
|
||||||
R.string.label_recent_updates)
|
|
||||||
entryValues = arrayOf("1", "2", "3")
|
|
||||||
defaultValue = "1"
|
|
||||||
summary = "%s"
|
|
||||||
}
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
preference {
|
|
||||||
titleRes = R.string.pref_manage_notifications
|
|
||||||
onClick {
|
|
||||||
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
|
|
||||||
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
|
|
||||||
}
|
|
||||||
startActivity(intent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preferenceCategory {
|
preferenceCategory {
|
||||||
|
@ -41,7 +41,7 @@ class SettingsLibraryController : SettingsController() {
|
|||||||
titleRes = R.string.pref_category_library
|
titleRes = R.string.pref_category_library
|
||||||
|
|
||||||
preferenceCategory {
|
preferenceCategory {
|
||||||
titleRes = R.string.pref_category_library_display
|
titleRes = R.string.pref_category_display
|
||||||
|
|
||||||
preference {
|
preference {
|
||||||
titleRes = R.string.pref_library_columns
|
titleRes = R.string.pref_library_columns
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
<string name="secure_screen_summary">Hide app contents when switching apps and block screenshots</string>
|
<string name="secure_screen_summary">Hide app contents when switching apps and block screenshots</string>
|
||||||
|
|
||||||
<!-- Library section -->
|
<!-- Library section -->
|
||||||
<string name="pref_category_library_display">Display</string>
|
<string name="pref_category_display">Display</string>
|
||||||
<string name="pref_library_columns">Library manga per row</string>
|
<string name="pref_library_columns">Library manga per row</string>
|
||||||
<string name="portrait">Portrait</string>
|
<string name="portrait">Portrait</string>
|
||||||
<string name="landscape">Landscape</string>
|
<string name="landscape">Landscape</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user