From 8512f97386f1d243e3e914df8f17a11f3cc315e2 Mon Sep 17 00:00:00 2001 From: len Date: Thu, 15 Sep 2016 18:39:16 +0200 Subject: [PATCH] Show default message when no categories selected --- .../tachiyomi/ui/setting/SettingsGeneralFragment.kt | 10 ++++++++-- app/src/main/res/values/strings.xml | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralFragment.kt index f16793d5ef..4bb6d3f59c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsGeneralFragment.kt @@ -84,10 +84,16 @@ class SettingsGeneralFragment : SettingsFragment(), subscriptions += preferences.libraryUpdateCategories().asObservable() .subscribe { - categoryUpdate.summary = it + val selectedCategories = it .mapNotNull { id -> dbCategories.find { it.id == id.toInt() } } .sortedBy { it.order } - .joinToString { it.name } + + val summary = if (selectedCategories.isEmpty()) + getString(R.string.all) + else + selectedCategories.joinToString { it.name } + + categoryUpdate.summary = summary } themePreference.setOnPreferenceChangeListener { preference, newValue -> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e82cf670dc..b5e7c1e300 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -86,6 +86,7 @@ Daily Every 2 days Categories to include in global update + All Library update restrictions Update only when the conditions are met Wi-Fi