mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
335d8eeb16
commit
98e7721354
@ -241,11 +241,7 @@ class BookshelfManageActivity :
|
||||
|
||||
override fun onMenuItemClick(item: MenuItem?): Boolean {
|
||||
when (item?.itemId) {
|
||||
R.id.menu_del_selection ->
|
||||
alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
|
||||
okButton { viewModel.deleteBook(*adapter.selection.toTypedArray()) }
|
||||
noButton()
|
||||
}
|
||||
R.id.menu_del_selection -> alertDelSelection()
|
||||
R.id.menu_update_enable ->
|
||||
viewModel.upCanUpdate(adapter.selection, true)
|
||||
R.id.menu_update_disable ->
|
||||
@ -266,6 +262,13 @@ class BookshelfManageActivity :
|
||||
}
|
||||
}
|
||||
|
||||
private fun alertDelSelection() {
|
||||
alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
|
||||
okButton { viewModel.deleteBook(*adapter.selection.toTypedArray()) }
|
||||
noButton()
|
||||
}
|
||||
}
|
||||
|
||||
override fun selectGroup(requestCode: Int, groupId: Long) {
|
||||
showDialogFragment(
|
||||
GroupSelectDialog(groupId, requestCode)
|
||||
|
Loading…
Reference in New Issue
Block a user