pull/83/head
kunfei 5 years ago
parent c1f51e3bd4
commit 5b7c6bcaab
  1. 9
      app/src/main/java/io/legado/app/base/BaseActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt

@ -52,9 +52,12 @@ abstract class BaseActivity(
} ?: super.onCreateOptionsMenu(menu) } ?: super.onCreateOptionsMenu(menu)
} }
override fun onMenuOpened(featureId: Int, menu: Menu): Boolean { override fun onMenuOpened(featureId: Int, menu: Menu?): Boolean {
menu.applyOpenTint(this) menu?.let {
return super.onMenuOpened(featureId, menu) menu.applyOpenTint(this)
return super.onMenuOpened(featureId, menu)
}
return true
} }
open fun onCompatCreateOptionsMenu(menu: Menu): Boolean { open fun onCompatCreateOptionsMenu(menu: Menu): Boolean {

@ -98,8 +98,8 @@ class BookInfoActivity :
return super.onCompatOptionsItemSelected(item) return super.onCompatOptionsItemSelected(item)
} }
override fun onMenuOpened(featureId: Int, menu: Menu): Boolean { override fun onMenuOpened(featureId: Int, menu: Menu?): Boolean {
menu.findItem(R.id.menu_can_update)?.isChecked = menu?.findItem(R.id.menu_can_update)?.isChecked =
viewModel.bookData.value?.canUpdate ?: true viewModel.bookData.value?.canUpdate ?: true
return super.onMenuOpened(featureId, menu) return super.onMenuOpened(featureId, menu)
} }

Loading…
Cancel
Save