mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 09:11:52 +01:00
Add shortcut to edit categories screen from category setting dialog (closes #6280)
This commit is contained in:
parent
86016de6cb
commit
a72098b862
@ -56,9 +56,16 @@ class ChangeMangaCategoriesDialog<T>(bundle: Bundle? = null) :
|
|||||||
.filterNotNull()
|
.filterNotNull()
|
||||||
(targetController as? Listener)?.updateCategoriesForMangas(mangas, add, remove)
|
(targetController as? Listener)?.updateCategoriesForMangas(mangas, add, remove)
|
||||||
}
|
}
|
||||||
|
setNeutralButton(R.string.action_edit) { _, _ -> openCategoryController() }
|
||||||
} else {
|
} else {
|
||||||
setMessage(R.string.information_empty_category_dialog)
|
setMessage(R.string.information_empty_category_dialog)
|
||||||
setPositiveButton(R.string.action_edit_categories) { _, _ ->
|
setPositiveButton(R.string.action_edit_categories) { _, _ -> openCategoryController() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.create()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun openCategoryController() {
|
||||||
if (targetController is LibraryController) {
|
if (targetController is LibraryController) {
|
||||||
val libController = targetController as LibraryController
|
val libController = targetController as LibraryController
|
||||||
libController.clearSelection()
|
libController.clearSelection()
|
||||||
@ -66,10 +73,6 @@ class ChangeMangaCategoriesDialog<T>(bundle: Bundle? = null) :
|
|||||||
router.popCurrentController()
|
router.popCurrentController()
|
||||||
router.pushController(CategoryController().withFadeTransaction())
|
router.pushController(CategoryController().withFadeTransaction())
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
.create()
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Listener {
|
interface Listener {
|
||||||
fun updateCategoriesForMangas(mangas: List<Manga>, addCategories: List<Category>, removeCategories: List<Category> = emptyList<Category>())
|
fun updateCategoriesForMangas(mangas: List<Manga>, addCategories: List<Category>, removeCategories: List<Category> = emptyList<Category>())
|
||||||
|
Loading…
Reference in New Issue
Block a user