pull/2240/head
kunfei 2 years ago
parent b274032099
commit e69291bcff
  1. 4
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  2. 22
      app/src/main/java/io/legado/app/ui/replace/ReplaceRuleActivity.kt
  3. 2
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt

@ -335,7 +335,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
override fun onClickSelectBarMainAction() { override fun onClickSelectBarMainAction() {
alert(titleResource = R.string.draw, messageResource = R.string.sure_del) { alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { viewModel.del(*adapter.selection.toTypedArray()) } yesButton { viewModel.del(*adapter.selection.toTypedArray()) }
noButton() noButton()
} }
} }
@ -588,7 +588,7 @@ class BookSourceActivity : VMBaseActivity<ActivityBookSourceBinding, BookSourceV
} }
override fun del(bookSource: BookSource) { override fun del(bookSource: BookSource) {
alert(R.string.delete_source) { alert(R.string.draw) {
setMessage(getString(R.string.sure_del) + "\n" + bookSource.bookSourceName) setMessage(getString(R.string.sure_del) + "\n" + bookSource.bookSourceName)
noButton() noButton()
yesButton { yesButton {

@ -162,7 +162,10 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
} }
override fun onClickSelectBarMainAction() { override fun onClickSelectBarMainAction() {
delSourceDialog() alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
yesButton { viewModel.delSelection(adapter.selection) }
noButton()
}
} }
private fun initSelectActionView() { private fun initSelectActionView() {
@ -172,13 +175,6 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
binding.selectActionBar.setCallBack(this) binding.selectActionBar.setCallBack(this)
} }
private fun delSourceDialog() {
alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { viewModel.delSelection(adapter.selection) }
noButton()
}
}
private fun observeReplaceRuleData(searchKey: String? = null) { private fun observeReplaceRuleData(searchKey: String? = null) {
dataInit = false dataInit = false
replaceRuleFlowJob?.cancel() replaceRuleFlowJob?.cancel()
@ -329,8 +325,14 @@ class ReplaceRuleActivity : VMBaseActivity<ActivityReplaceRuleBinding, ReplaceRu
} }
override fun delete(rule: ReplaceRule) { override fun delete(rule: ReplaceRule) {
setResult(RESULT_OK) alert(R.string.draw) {
viewModel.delete(rule) setMessage(getString(R.string.sure_del) + "\n" + rule.name)
noButton()
yesButton {
setResult(RESULT_OK)
viewModel.delete(rule)
}
}
} }
override fun edit(rule: ReplaceRule) { override fun edit(rule: ReplaceRule) {

@ -329,7 +329,7 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
} }
override fun del(source: RssSource) { override fun del(source: RssSource) {
alert(R.string.delete_source) { alert(R.string.draw) {
setMessage(getString(R.string.sure_del) + "\n" + source.sourceName) setMessage(getString(R.string.sure_del) + "\n" + source.sourceName)
noButton() noButton()
yesButton { yesButton {

Loading…
Cancel
Save