Rename offline mode to downloaded only

This commit is contained in:
arkon 2020-04-19 16:02:33 -04:00
parent 5bc77fc6e8
commit abbb329ba6
8 changed files with 13 additions and 13 deletions

View file

@ -99,7 +99,7 @@ object PreferenceKeys {
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"

View file

@ -183,7 +183,7 @@ class PreferencesHelper(val context: Context) {
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)

View file

@ -111,7 +111,7 @@ class LibraryPresenter(
* @param map the map to filter.
*/
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 filterCompleted = preferences.filterCompleted().getOrDefault()

View file

@ -96,8 +96,8 @@ class LibrarySettingsSheet(
override val footer = Item.Separator()
override fun initModels() {
downloaded.checked = preferences.offlineMode().get() || preferences.filterDownloaded().getOrDefault()
downloaded.enabled = !preferences.offlineMode().get()
downloaded.checked = preferences.downloadedOnly().get() || preferences.filterDownloaded().getOrDefault()
downloaded.enabled = !preferences.downloadedOnly().get()
unread.checked = preferences.filterUnread().getOrDefault()
completed.checked = preferences.filterCompleted().getOrDefault()
}

View file

@ -155,7 +155,7 @@ class ChaptersController : NucleusController<ChaptersControllerBinding, Chapters
menuFilterRead.isChecked = presenter.onlyRead()
menuFilterUnread.isChecked = presenter.onlyUnread()
menuFilterDownloaded.isChecked = presenter.onlyDownloaded()
menuFilterDownloaded.isEnabled = !presenter.isOfflineMode()
menuFilterDownloaded.isEnabled = !presenter.forceDownloaded()
menuFilterBookmarked.isChecked = presenter.onlyBookmarked()
val filterSet = presenter.onlyRead() || presenter.onlyUnread() || presenter.onlyDownloaded() || presenter.onlyBookmarked()

View file

@ -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 {
return preferences.offlineMode().get()
fun forceDownloaded(): Boolean {
return preferences.downloadedOnly().get()
}
/**
* Whether the display only downloaded filter is enabled.
*/
fun onlyDownloaded(): Boolean {
return isOfflineMode() || manga.downloadedFilter == Manga.SHOW_DOWNLOADED
return forceDownloaded() || manga.downloadedFilter == Manga.SHOW_DOWNLOADED
}
/**

View file

@ -32,8 +32,8 @@ class MoreController : SettingsController(), RootController {
val tintColor = context.getResourceColor(R.attr.colorAccent)
switchPreference {
key = Keys.offlineMode
titleRes = R.string.label_offline_mode
key = Keys.downloadedOnly
titleRes = R.string.label_downloaded_only
iconRes = R.drawable.ic_cloud_off_24dp
iconTint = tintColor
}

View file

@ -12,7 +12,7 @@
<!-- Activities and fragments labels (toolbar title) -->
<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_download_queue">Download queue</string>
<string name="label_library">Library</string>