From fff0f841fa159b442af87625a29cbc3200dd59f2 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 17 Jul 2020 14:44:09 -0400 Subject: [PATCH] Long press favorite button to manage categories --- .../java/eu/kanade/tachiyomi/ui/manga/MangaController.kt | 2 +- .../tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt index 293416cdc3..90ab1a6a4a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt @@ -526,7 +526,7 @@ class MangaController : mangaInfoAdapter?.notifyDataSetChanged() } - private fun onCategoriesClick() { + fun onCategoriesClick() { val manga = presenter.manga val categories = presenter.getCategories() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt index 26d0d07829..d10256337d 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoHeaderAdapter.kt @@ -85,6 +85,12 @@ class MangaInfoHeaderAdapter( .onEach { controller.onFavoriteClick() } .launchIn(scope) + if (controller.presenter.manga.favorite && controller.presenter.getCategories().isNotEmpty()) { + binding.btnFavorite.longClicks() + .onEach { controller.onCategoriesClick() } + .launchIn(scope) + } + if (controller.presenter.manga.favorite && Injekt.get().hasLoggedServices()) { binding.btnTracking.visible() binding.btnTracking.clicks()