Browse Source

Rename offline mode to downloaded only

arkon 5 years ago
parent
commit
abbb329ba6

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt

@@ -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"
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt

@@ -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)
 

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt

@@ -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()
 

+ 2 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/library/LibrarySettingsSheet.kt

@@ -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()
             }

+ 1 - 1
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersController.kt

@@ -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()

+ 4 - 4
app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/ChaptersPresenter.kt

@@ -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
     }
 
     /**

+ 2 - 2
app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreController.kt

@@ -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
         }

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -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>