Add a option to open the library bottom sheet in the library Settings
This commit is contained in:
parent
d3603a664c
commit
5fee3ac05a
@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.data.preference.asImmediateFlow
|
|||||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
import eu.kanade.tachiyomi.ui.base.controller.withFadeTransaction
|
||||||
import eu.kanade.tachiyomi.ui.category.CategoryController
|
import eu.kanade.tachiyomi.ui.category.CategoryController
|
||||||
|
import eu.kanade.tachiyomi.ui.library.LibrarySettingsSheet
|
||||||
import eu.kanade.tachiyomi.util.preference.defaultValue
|
import eu.kanade.tachiyomi.util.preference.defaultValue
|
||||||
import eu.kanade.tachiyomi.util.preference.entriesRes
|
import eu.kanade.tachiyomi.util.preference.entriesRes
|
||||||
import eu.kanade.tachiyomi.util.preference.intListPreference
|
import eu.kanade.tachiyomi.util.preference.intListPreference
|
||||||
@ -40,11 +41,17 @@ class SettingsLibraryController : SettingsController() {
|
|||||||
|
|
||||||
private val db: DatabaseHelper = Injekt.get()
|
private val db: DatabaseHelper = Injekt.get()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sheet containing filter/sort/display items.
|
||||||
|
*/
|
||||||
|
private var settingsSheet: LibrarySettingsSheet? = null
|
||||||
|
|
||||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||||
titleRes = R.string.pref_category_library
|
titleRes = R.string.pref_category_library
|
||||||
|
|
||||||
val dbCategories = db.getCategories().executeAsBlocking()
|
val dbCategories = db.getCategories().executeAsBlocking()
|
||||||
val categories = listOf(Category.createDefault()) + dbCategories
|
val categories = listOf(Category.createDefault()) + dbCategories
|
||||||
|
settingsSheet = LibrarySettingsSheet(activity!!) {}
|
||||||
|
|
||||||
preferenceCategory {
|
preferenceCategory {
|
||||||
titleRes = R.string.pref_category_display
|
titleRes = R.string.pref_category_display
|
||||||
@ -77,6 +84,17 @@ class SettingsLibraryController : SettingsController() {
|
|||||||
titleRes = R.string.pref_jump_to_chapters
|
titleRes = R.string.pref_jump_to_chapters
|
||||||
defaultValue = false
|
defaultValue = false
|
||||||
}
|
}
|
||||||
|
// SY -->
|
||||||
|
preference {
|
||||||
|
titleRes = R.string.library_settings_sheet
|
||||||
|
|
||||||
|
summaryRes = R.string.library_settings_sheet_summary
|
||||||
|
|
||||||
|
onClick {
|
||||||
|
settingsSheet?.show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Sy <--
|
||||||
}
|
}
|
||||||
|
|
||||||
preferenceCategory {
|
preferenceCategory {
|
||||||
|
@ -149,6 +149,8 @@
|
|||||||
|
|
||||||
<!-- Library settings -->
|
<!-- Library settings -->
|
||||||
<string name="pref_skip_pre_migration_summary">Use last saved pre-migration preferences and sources to mass migrate</string>
|
<string name="pref_skip_pre_migration_summary">Use last saved pre-migration preferences and sources to mass migrate</string>
|
||||||
|
<string name="library_settings_sheet">Library settings sheet</string>
|
||||||
|
<string name="library_settings_sheet_summary">More library display settings</string>
|
||||||
|
|
||||||
<!-- Reader Settings -->
|
<!-- Reader Settings -->
|
||||||
<string name="download_threads">Download threads</string>
|
<string name="download_threads">Download threads</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user