mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Add shortcut to edit categories screen from category setting dialog (closes #6280)
This commit is contained in:
		| @@ -56,21 +56,24 @@ class ChangeMangaCategoriesDialog<T>(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<Manga>, addCategories: List<Category>, removeCategories: List<Category> = emptyList<Category>()) | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user