Show number of categories in setting summary

This commit is contained in:
arkon 2020-05-02 10:47:21 -04:00
parent e58896bdfb
commit 04d7eccc63
2 changed files with 8 additions and 0 deletions

View File

@ -171,6 +171,10 @@ class SettingsLibraryController : SettingsController() {
preference {
titleRes = R.string.action_edit_categories
val catCount = db.getCategories().executeAsBlocking().size
summary = context.resources.getQuantityString(R.plurals.num_categories, catCount, catCount)
onClick {
router.pushController(CategoryController().withFadeTransaction())
}

View File

@ -186,6 +186,10 @@
<string name="pref_category_library_categories">Categories</string>
<string name="default_category">Default category</string>
<string name="default_category_summary">Always ask</string>
<plurals name="num_categories">
<item quantity="one">%d category</item>
<item quantity="other">%d categories</item>
</plurals>
<string name="pref_library_update_categories">Categories to include in global update</string>
<string name="all">All</string>