|
|
@ -241,11 +241,7 @@ class BookshelfManageActivity : |
|
|
|
|
|
|
|
|
|
|
|
override fun onMenuItemClick(item: MenuItem?): Boolean { |
|
|
|
override fun onMenuItemClick(item: MenuItem?): Boolean { |
|
|
|
when (item?.itemId) { |
|
|
|
when (item?.itemId) { |
|
|
|
R.id.menu_del_selection -> |
|
|
|
R.id.menu_del_selection -> alertDelSelection() |
|
|
|
alert(titleResource = R.string.draw, messageResource = R.string.sure_del) { |
|
|
|
|
|
|
|
okButton { viewModel.deleteBook(*adapter.selection.toTypedArray()) } |
|
|
|
|
|
|
|
noButton() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
R.id.menu_update_enable -> |
|
|
|
R.id.menu_update_enable -> |
|
|
|
viewModel.upCanUpdate(adapter.selection, true) |
|
|
|
viewModel.upCanUpdate(adapter.selection, true) |
|
|
|
R.id.menu_update_disable -> |
|
|
|
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) { |
|
|
|
override fun selectGroup(requestCode: Int, groupId: Long) { |
|
|
|
showDialogFragment( |
|
|
|
showDialogFragment( |
|
|
|
GroupSelectDialog(groupId, requestCode) |
|
|
|
GroupSelectDialog(groupId, requestCode) |
|
|
|