From 88ee86b7ef9c4bf8170d111f1ae2ab56871d7688 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 16 Jul 2020 22:22:06 -0400 Subject: [PATCH] Move edit categories to overflow --- .../eu/kanade/tachiyomi/ui/manga/MangaController.kt | 6 ++++-- .../ui/manga/info/MangaInfoHeaderAdapter.kt | 12 ------------ app/src/main/res/layout/manga_info_header.xml | 11 ----------- app/src/main/res/menu/chapters.xml | 5 +++++ app/src/main/res/values/styles.xml | 2 ++ 5 files changed, 11 insertions(+), 25 deletions(-) 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 6a30829a0a..baf15f8e4a 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 @@ -315,7 +315,8 @@ class MangaController : // Hide download options for local manga menu.findItem(R.id.download_group).isVisible = !isLocalSource - // Hide edit cover and migrate options for non-library manga + // Hide options for non-library manga + menu.findItem(R.id.action_edit_categories).isVisible = presenter.manga.favorite && presenter.getCategories().isNotEmpty() menu.findItem(R.id.action_edit_cover).isVisible = presenter.manga.favorite menu.findItem(R.id.action_migrate).isVisible = presenter.manga.favorite } @@ -377,6 +378,7 @@ class MangaController : activity?.invalidateOptionsMenu() } + R.id.action_edit_categories -> onCategoriesClick() R.id.action_edit_cover -> handleChangeCover() R.id.action_migrate -> migrateManga() } @@ -526,7 +528,7 @@ class MangaController : mangaInfoAdapter?.notifyDataSetChanged() } - fun onCategoriesClick() { + private 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 844736a1f8..26d0d07829 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 @@ -94,16 +94,6 @@ class MangaInfoHeaderAdapter( binding.btnTracking.gone() } - if (controller.presenter.manga.favorite && controller.presenter.getCategories().isNotEmpty()) { - binding.btnCategories.visible() - binding.btnCategories.clicks() - .onEach { controller.onCategoriesClick() } - .launchIn(scope) - binding.btnCategories.setTooltip(R.string.action_move_category) - } else { - binding.btnCategories.gone() - } - if (controller.presenter.source is HttpSource) { binding.btnWebview.visible() binding.btnWebview.clicks() @@ -286,8 +276,6 @@ class MangaInfoHeaderAdapter( initialLoad = false } } - - binding.btnCategories.visibleIf { manga.favorite && controller.presenter.getCategories().isNotEmpty() } } private fun showMangaInfo(visible: Boolean) { diff --git a/app/src/main/res/layout/manga_info_header.xml b/app/src/main/res/layout/manga_info_header.xml index 81fa08b97a..ae0a036643 100644 --- a/app/src/main/res/layout/manga_info_header.xml +++ b/app/src/main/res/layout/manga_info_header.xml @@ -142,17 +142,6 @@ app:icon="@drawable/ic_sync_24dp" tools:visibility="visible" /> - - + + 0dp 4dp + 8dp + 16dp 0dp