From a72098b86272f62d2a2f9a7d4a82a4dcb2ed3930 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 5 Mar 2022 22:36:41 -0500 Subject: [PATCH] Add shortcut to edit categories screen from category setting dialog (closes #6280) --- .../ui/library/ChangeMangaCategoriesDialog.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/ChangeMangaCategoriesDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/ChangeMangaCategoriesDialog.kt index e393d4464d..6c7802dc9a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/ChangeMangaCategoriesDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/ChangeMangaCategoriesDialog.kt @@ -56,21 +56,24 @@ class ChangeMangaCategoriesDialog(bundle: Bundle? = null) : .filterNotNull() (targetController as? Listener)?.updateCategoriesForMangas(mangas, add, remove) } + setNeutralButton(R.string.action_edit) { _, _ -> openCategoryController() } } else { setMessage(R.string.information_empty_category_dialog) - setPositiveButton(R.string.action_edit_categories) { _, _ -> - if (targetController is LibraryController) { - val libController = targetController as LibraryController - libController.clearSelection() - } - router.popCurrentController() - router.pushController(CategoryController().withFadeTransaction()) - } + setPositiveButton(R.string.action_edit_categories) { _, _ -> openCategoryController() } } } .create() } + private fun openCategoryController() { + if (targetController is LibraryController) { + val libController = targetController as LibraryController + libController.clearSelection() + } + router.popCurrentController() + router.pushController(CategoryController().withFadeTransaction()) + } + interface Listener { fun updateCategoriesForMangas(mangas: List, addCategories: List, removeCategories: List = emptyList()) }