mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 20:51:47 +01:00
Rename offline mode to downloaded only
This commit is contained in:
parent
5bc77fc6e8
commit
abbb329ba6
@ -99,7 +99,7 @@ object PreferenceKeys {
|
|||||||
|
|
||||||
const val libraryUpdatePrioritization = "library_update_prioritization"
|
const val libraryUpdatePrioritization = "library_update_prioritization"
|
||||||
|
|
||||||
const val offlineMode = "pref_offline_mode"
|
const val downloadedOnly = "pref_downloaded_only"
|
||||||
|
|
||||||
const val filterDownloaded = "pref_filter_downloaded_key"
|
const val filterDownloaded = "pref_filter_downloaded_key"
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ class PreferencesHelper(val context: Context) {
|
|||||||
|
|
||||||
fun downloadBadge() = rxPrefs.getBoolean(Keys.downloadBadge, false)
|
fun downloadBadge() = rxPrefs.getBoolean(Keys.downloadBadge, false)
|
||||||
|
|
||||||
fun offlineMode() = flowPrefs.getBoolean(Keys.offlineMode, false)
|
fun downloadedOnly() = flowPrefs.getBoolean(Keys.downloadedOnly, false)
|
||||||
|
|
||||||
fun filterDownloaded() = rxPrefs.getBoolean(Keys.filterDownloaded, false)
|
fun filterDownloaded() = rxPrefs.getBoolean(Keys.filterDownloaded, false)
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ class LibraryPresenter(
|
|||||||
* @param map the map to filter.
|
* @param map the map to filter.
|
||||||
*/
|
*/
|
||||||
private fun applyFilters(map: LibraryMap): LibraryMap {
|
private fun applyFilters(map: LibraryMap): LibraryMap {
|
||||||
val filterDownloaded = preferences.offlineMode().get() || preferences.filterDownloaded().getOrDefault()
|
val filterDownloaded = preferences.downloadedOnly().get() || preferences.filterDownloaded().getOrDefault()
|
||||||
val filterUnread = preferences.filterUnread().getOrDefault()
|
val filterUnread = preferences.filterUnread().getOrDefault()
|
||||||
val filterCompleted = preferences.filterCompleted().getOrDefault()
|
val filterCompleted = preferences.filterCompleted().getOrDefault()
|
||||||
|
|
||||||
|
@ -96,8 +96,8 @@ class LibrarySettingsSheet(
|
|||||||
override val footer = Item.Separator()
|
override val footer = Item.Separator()
|
||||||
|
|
||||||
override fun initModels() {
|
override fun initModels() {
|
||||||
downloaded.checked = preferences.offlineMode().get() || preferences.filterDownloaded().getOrDefault()
|
downloaded.checked = preferences.downloadedOnly().get() || preferences.filterDownloaded().getOrDefault()
|
||||||
downloaded.enabled = !preferences.offlineMode().get()
|
downloaded.enabled = !preferences.downloadedOnly().get()
|
||||||
unread.checked = preferences.filterUnread().getOrDefault()
|
unread.checked = preferences.filterUnread().getOrDefault()
|
||||||
completed.checked = preferences.filterCompleted().getOrDefault()
|
completed.checked = preferences.filterCompleted().getOrDefault()
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ class ChaptersController : NucleusController<ChaptersControllerBinding, Chapters
|
|||||||
menuFilterRead.isChecked = presenter.onlyRead()
|
menuFilterRead.isChecked = presenter.onlyRead()
|
||||||
menuFilterUnread.isChecked = presenter.onlyUnread()
|
menuFilterUnread.isChecked = presenter.onlyUnread()
|
||||||
menuFilterDownloaded.isChecked = presenter.onlyDownloaded()
|
menuFilterDownloaded.isChecked = presenter.onlyDownloaded()
|
||||||
menuFilterDownloaded.isEnabled = !presenter.isOfflineMode()
|
menuFilterDownloaded.isEnabled = !presenter.forceDownloaded()
|
||||||
menuFilterBookmarked.isChecked = presenter.onlyBookmarked()
|
menuFilterBookmarked.isChecked = presenter.onlyBookmarked()
|
||||||
|
|
||||||
val filterSet = presenter.onlyRead() || presenter.onlyUnread() || presenter.onlyDownloaded() || presenter.onlyBookmarked()
|
val filterSet = presenter.onlyRead() || presenter.onlyUnread() || presenter.onlyDownloaded() || presenter.onlyBookmarked()
|
||||||
|
@ -367,17 +367,17 @@ class ChaptersPresenter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether offline mode is enabled (i.e. force only downloaded content).
|
* Whether downloaded only mode is enabled.
|
||||||
*/
|
*/
|
||||||
fun isOfflineMode(): Boolean {
|
fun forceDownloaded(): Boolean {
|
||||||
return preferences.offlineMode().get()
|
return preferences.downloadedOnly().get()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the display only downloaded filter is enabled.
|
* Whether the display only downloaded filter is enabled.
|
||||||
*/
|
*/
|
||||||
fun onlyDownloaded(): Boolean {
|
fun onlyDownloaded(): Boolean {
|
||||||
return isOfflineMode() || manga.downloadedFilter == Manga.SHOW_DOWNLOADED
|
return forceDownloaded() || manga.downloadedFilter == Manga.SHOW_DOWNLOADED
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,8 +32,8 @@ class MoreController : SettingsController(), RootController {
|
|||||||
val tintColor = context.getResourceColor(R.attr.colorAccent)
|
val tintColor = context.getResourceColor(R.attr.colorAccent)
|
||||||
|
|
||||||
switchPreference {
|
switchPreference {
|
||||||
key = Keys.offlineMode
|
key = Keys.downloadedOnly
|
||||||
titleRes = R.string.label_offline_mode
|
titleRes = R.string.label_downloaded_only
|
||||||
iconRes = R.drawable.ic_cloud_off_24dp
|
iconRes = R.drawable.ic_cloud_off_24dp
|
||||||
iconTint = tintColor
|
iconTint = tintColor
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<!-- Activities and fragments labels (toolbar title) -->
|
<!-- Activities and fragments labels (toolbar title) -->
|
||||||
<string name="label_more">More</string>
|
<string name="label_more">More</string>
|
||||||
<string name="label_offline_mode">Offline mode</string>
|
<string name="label_downloaded_only">Downloaded only</string>
|
||||||
<string name="label_settings">Settings</string>
|
<string name="label_settings">Settings</string>
|
||||||
<string name="label_download_queue">Download queue</string>
|
<string name="label_download_queue">Download queue</string>
|
||||||
<string name="label_library">Library</string>
|
<string name="label_library">Library</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user