mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-25 02:18:24 +01:00
Hide download menu for local manga
This commit is contained in:
parent
a1917b8c81
commit
eca593ac36
@ -82,6 +82,8 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) :
|
|||||||
*/
|
*/
|
||||||
private val selectedChapters = mutableSetOf<ChapterItem>()
|
private val selectedChapters = mutableSetOf<ChapterItem>()
|
||||||
|
|
||||||
|
private val isLocalSource by lazy { presenter.source.id == LocalSource.ID }
|
||||||
|
|
||||||
private var lastClickPosition = -1
|
private var lastClickPosition = -1
|
||||||
|
|
||||||
private var isRefreshingInfo = false
|
private var isRefreshingInfo = false
|
||||||
@ -229,6 +231,9 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) :
|
|||||||
}
|
}
|
||||||
menu.findItem(sortingItem).isChecked = true
|
menu.findItem(sortingItem).isChecked = true
|
||||||
menu.findItem(R.id.action_sort_descending).isChecked = presenter.manga.sortDescending()
|
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 {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
@ -663,7 +668,6 @@ class MangaInfoChaptersController(private val fromSource: Boolean = false) :
|
|||||||
} else {
|
} else {
|
||||||
mode.title = count.toString()
|
mode.title = count.toString()
|
||||||
|
|
||||||
val isLocalSource = presenter.source.id == LocalSource.ID
|
|
||||||
val chapters = getSelectedChapters()
|
val chapters = getSelectedChapters()
|
||||||
binding.actionToolbar.findItem(R.id.action_download)?.isVisible = !isLocalSource && chapters.any { !it.isDownloaded }
|
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 }
|
binding.actionToolbar.findItem(R.id.action_delete)?.isVisible = !isLocalSource && chapters.any { it.isDownloaded }
|
||||||
|
@ -72,6 +72,7 @@
|
|||||||
</item>
|
</item>
|
||||||
|
|
||||||
<item
|
<item
|
||||||
|
android:id="@+id/download_group"
|
||||||
android:title="@string/manga_download"
|
android:title="@string/manga_download"
|
||||||
app:showAsAction="never">
|
app:showAsAction="never">
|
||||||
<menu>
|
<menu>
|
||||||
|
Loading…
Reference in New Issue
Block a user