diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index d7cd4637d..cf89e975c 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -76,10 +76,21 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo viewModel.loadBookInfo(it) } } + R.id.menu_can_update -> { + viewModel.bookData.value?.let { + it.canUpdate = !it.canUpdate + } + } } return super.onCompatOptionsItemSelected(item) } + override fun onMenuOpened(featureId: Int, menu: Menu?): Boolean { + menu?.findItem(R.id.menu_can_update)?.isChecked = + viewModel.bookData.value?.canUpdate ?: true + return super.onMenuOpened(featureId, menu) + } + private fun showBook(book: Book) { tv_name.text = book.name tv_author.text = getString(R.string.author_show, book.author) diff --git a/app/src/main/res/menu/book_info.xml b/app/src/main/res/menu/book_info.xml index 75bf8d6db..2f36f90b4 100644 --- a/app/src/main/res/menu/book_info.xml +++ b/app/src/main/res/menu/book_info.xml @@ -15,7 +15,8 @@ \ No newline at end of file