Tri-state library filters (closes #1814)

Based on https://github.com/inorichi/tachiyomi/pull/2127.

Co-authored-by: hXtreme <hXtreme@users.noreply.github.com>
This commit is contained in:
arkon
2020-09-14 17:52:00 -04:00
parent da5f10a2f1
commit 687f3d48ea
6 changed files with 128 additions and 51 deletions

View File

@@ -109,11 +109,11 @@ object PreferenceKeys {
const val downloadedOnly = "pref_downloaded_only"
const val filterDownloaded = "pref_filter_downloaded_key"
const val filterDownloaded = "pref_filter_library_downloaded"
const val filterUnread = "pref_filter_unread_key"
const val filterUnread = "pref_filter_library_unread"
const val filterCompleted = "pref_filter_completed_key"
const val filterCompleted = "pref_filter_library_completed"
const val librarySortingMode = "library_sorting_mode"

View File

@@ -13,6 +13,7 @@ import eu.kanade.tachiyomi.data.preference.PreferenceValues.DisplayMode
import eu.kanade.tachiyomi.data.preference.PreferenceValues.NsfwAllowance
import eu.kanade.tachiyomi.data.track.TrackService
import eu.kanade.tachiyomi.data.track.anilist.Anilist
import eu.kanade.tachiyomi.widget.ExtendedNavigationView
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.onEach
@@ -210,11 +211,11 @@ class PreferencesHelper(val context: Context) {
fun categoryTabs() = flowPrefs.getBoolean(Keys.categoryTabs, true)
fun filterDownloaded() = flowPrefs.getBoolean(Keys.filterDownloaded, false)
fun filterDownloaded() = flowPrefs.getInt(Keys.filterDownloaded, ExtendedNavigationView.Item.TriStateGroup.STATE_IGNORE)
fun filterUnread() = flowPrefs.getBoolean(Keys.filterUnread, false)
fun filterUnread() = flowPrefs.getInt(Keys.filterUnread, ExtendedNavigationView.Item.TriStateGroup.STATE_IGNORE)
fun filterCompleted() = flowPrefs.getBoolean(Keys.filterCompleted, false)
fun filterCompleted() = flowPrefs.getInt(Keys.filterCompleted, ExtendedNavigationView.Item.TriStateGroup.STATE_IGNORE)
fun librarySortingMode() = flowPrefs.getInt(Keys.librarySortingMode, 0)