From bdcc6e52e6871c5e7b0190a4da74f516c6826e42 Mon Sep 17 00:00:00 2001 From: Bram van de Kerkhof Date: Mon, 1 Jan 2018 14:57:20 +0100 Subject: [PATCH] Small new user improvements (#1143) - Changed empty library string - Added empty view for Categories --- .../tachiyomi/ui/category/CategoryController.kt | 11 ++++++++--- app/src/main/res/drawable/ic_shape_black_128dp.xml | 9 +++++++++ app/src/main/res/layout/categories_controller.xml | 7 +++++++ app/src/main/res/layout/common_view_empty.xml | 2 ++ app/src/main/res/layout/library_controller.xml | 4 +--- app/src/main/res/values-ar/strings.xml | 2 +- app/src/main/res/values-nl/strings.xml | 5 +++-- app/src/main/res/values/strings.xml | 3 ++- 8 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 app/src/main/res/drawable/ic_shape_black_128dp.xml diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt index 8f7f055b0a..843a83e715 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/category/CategoryController.kt @@ -107,9 +107,14 @@ class CategoryController : NucleusController(), fun setCategories(categories: List) { actionMode?.finish() adapter?.updateDataSet(categories) - val selected = categories.filter { it.isSelected } - if (selected.isNotEmpty()) { - selected.forEach { onItemLongClick(categories.indexOf(it)) } + if (categories.isNotEmpty()) { + empty_view.hide() + val selected = categories.filter { it.isSelected } + if (selected.isNotEmpty()) { + selected.forEach { onItemLongClick(categories.indexOf(it)) } + } + } else { + empty_view.show(R.drawable.ic_shape_black_128dp, R.string.information_empty_category) } } diff --git a/app/src/main/res/drawable/ic_shape_black_128dp.xml b/app/src/main/res/drawable/ic_shape_black_128dp.xml new file mode 100644 index 0000000000..98a101f5ef --- /dev/null +++ b/app/src/main/res/drawable/ic_shape_black_128dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/categories_controller.xml b/app/src/main/res/layout/categories_controller.xml index f0930b6ce2..9bc79a6c39 100644 --- a/app/src/main/res/layout/categories_controller.xml +++ b/app/src/main/res/layout/categories_controller.xml @@ -19,4 +19,11 @@ app:srcCompat="@drawable/ic_add_white_24dp" style="@style/Theme.Widget.FAB"/> + + \ No newline at end of file diff --git a/app/src/main/res/layout/common_view_empty.xml b/app/src/main/res/layout/common_view_empty.xml index ef3cb14164..03e3292592 100644 --- a/app/src/main/res/layout/common_view_empty.xml +++ b/app/src/main/res/layout/common_view_empty.xml @@ -13,10 +13,12 @@ diff --git a/app/src/main/res/layout/library_controller.xml b/app/src/main/res/layout/library_controller.xml index e315b9b920..b0bed0ca56 100644 --- a/app/src/main/res/layout/library_controller.xml +++ b/app/src/main/res/layout/library_controller.xml @@ -1,7 +1,5 @@ - diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 6d85488db4..f81c575f34 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -14,7 +14,7 @@ تحديثات المكتبة آخر التحديثات الأقسام - المحدد + %1$d المحدد النسخ الاحتياطي اﻹعدادات diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 4bc3875761..e92d54ba7d 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -9,7 +9,7 @@ Instellingen Mijn bibliotheek Onlangs gelezen - Catalogen + Catalogi Laatste updates Categorieën Geselecteerd: %1$d @@ -285,7 +285,8 @@ Geen downloads Geen recente hoofdstukken - Bibliotheek leeg + De bibliotheek is leeg, manga kunnen toegevoegd worden vanuit de catalogi. + Er zijn nog geen categorieën, druk op de plus knop om een categorie aan te maken. Downloader Error diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 354af628d8..86556a0da1 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -431,7 +431,8 @@ No downloads No recent chapters No recently read manga - Empty library + Your library is empty, you can add series to your library from the Catalogues. + You have no categories. Hit the plus button to create one for organizing your library. Downloader