From eca593ac36aa16068367cc651531fe68feaf7e81 Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 28 Jun 2020 22:29:49 -0400 Subject: [PATCH] Hide download menu for local manga --- .../ui/manga/chapter/MangaInfoChaptersController.kt | 6 +++++- app/src/main/res/menu/chapters.xml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt index dd73386646..ab681d47f2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/chapter/MangaInfoChaptersController.kt @@ -82,6 +82,8 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) : */ private val selectedChapters = mutableSetOf() + private val isLocalSource by lazy { presenter.source.id == LocalSource.ID } + private var lastClickPosition = -1 private var isRefreshingInfo = false @@ -229,6 +231,9 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) : } menu.findItem(sortingItem).isChecked = true menu.findItem(R.id.action_sort_descending).isChecked = presenter.manga.sortDescending() + + // Hide download options for local manga + menu.findItem(R.id.download_group).isVisible = !isLocalSource } override fun onOptionsItemSelected(item: MenuItem): Boolean { @@ -663,7 +668,6 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) : } else { mode.title = count.toString() - val isLocalSource = presenter.source.id == LocalSource.ID val chapters = getSelectedChapters() binding.actionToolbar.findItem(R.id.action_download)?.isVisible = !isLocalSource && chapters.any { !it.isDownloaded } binding.actionToolbar.findItem(R.id.action_delete)?.isVisible = !isLocalSource && chapters.any { it.isDownloaded } diff --git a/app/src/main/res/menu/chapters.xml b/app/src/main/res/menu/chapters.xml index 1530bb7591..e356b755c7 100644 --- a/app/src/main/res/menu/chapters.xml +++ b/app/src/main/res/menu/chapters.xml @@ -72,6 +72,7 @@