mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Hide download/delete actions when sensible, make bookmark/read toggle actions
This commit is contained in:
		@@ -368,6 +368,14 @@ class ChaptersController : NucleusController<ChaptersPresenter>(),
 | 
			
		||||
        } else {
 | 
			
		||||
            mode.title = count.toString()
 | 
			
		||||
 | 
			
		||||
            val chapters = getSelectedChapters()
 | 
			
		||||
            action_toolbar.findItem(R.id.action_download)?.isVisible = chapters.any { !it.isDownloaded }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_delete)?.isVisible = chapters.any { it.isDownloaded }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_bookmark)?.isVisible = chapters.any { !it.chapter.bookmark }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_remove_bookmark)?.isVisible = chapters.all { it.chapter.bookmark }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_mark_as_read)?.isVisible = chapters.any { !it.chapter.read }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_mark_as_unread)?.isVisible = chapters.all { it.chapter.read }
 | 
			
		||||
 | 
			
		||||
            // Hide FAB to avoid interfering with the bottom action toolbar
 | 
			
		||||
            fab.hide()
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
@@ -296,6 +296,12 @@ class UpdatesController : NucleusController<UpdatesPresenter>(),
 | 
			
		||||
            destroyActionModeIfNeeded()
 | 
			
		||||
        } else {
 | 
			
		||||
            mode.title = count.toString()
 | 
			
		||||
 | 
			
		||||
            val chapters = getSelectedChapters()
 | 
			
		||||
            action_toolbar.findItem(R.id.action_download)?.isVisible = chapters.any { !it.isDownloaded }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_delete)?.isVisible = chapters.any { it.isDownloaded }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_mark_as_read)?.isVisible = chapters.any { !it.chapter.read }
 | 
			
		||||
            action_toolbar.findItem(R.id.action_mark_as_unread)?.isVisible = chapters.all { it.chapter.read }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return false
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user