From 1f67695713a3d670cd6269701deef1fda1d8ac73 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 11 Jul 2020 19:29:40 -0400 Subject: [PATCH] Hide migrate option for non-favorited manga --- .../tachiyomi/ui/manga/MangaController.kt | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 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 6e5be3582e..d9b0af010c 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 @@ -172,17 +172,9 @@ class MangaController : if (manga == null || source == null) return // Init RecyclerView and adapter - mangaInfoAdapter = - MangaInfoHeaderAdapter( - this, - fromSource - ) - chaptersHeaderAdapter = - MangaChaptersHeaderAdapter() - chaptersAdapter = ChaptersAdapter( - this, - view.context - ) + mangaInfoAdapter = MangaInfoHeaderAdapter(this, fromSource) + chaptersHeaderAdapter = MangaChaptersHeaderAdapter() + chaptersAdapter = ChaptersAdapter(this, view.context) binding.recycler.adapter = ConcatAdapter(mangaInfoAdapter, chaptersHeaderAdapter, chaptersAdapter) binding.recycler.layoutManager = LinearLayoutManager(view.context) @@ -317,6 +309,9 @@ class MangaController : // Hide download options for local manga menu.findItem(R.id.download_group).isVisible = !isLocalSource + + // Hide migrate option for non-library manga + menu.findItem(R.id.action_migrate).isVisible = presenter.manga.favorite } override fun onOptionsItemSelected(item: MenuItem): Boolean { @@ -466,6 +461,9 @@ class MangaController : } else { addToLibrary(manga) } + + // Update menu to show migrate option + activity?.invalidateOptionsMenu() } fun onTrackingClick() {