feat: 优化代码

pull/97/head
kunfei 5 years ago
parent a3f324aa52
commit dae7fd390c
  1. 4
      app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt
  3. 2
      app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt
  4. 2
      app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt
  5. 2
      app/src/main/res/values/strings.xml

@ -141,7 +141,7 @@ class ArrangeBookActivity : VMBaseActivity<ArrangeBookViewModel>(R.layout.activi
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 ->
alert(titleResource = R.string.sure, messageResource = R.string.sure_del) { alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { viewModel.deleteBook(*adapter.selectedBooks.toTypedArray()) } okButton { viewModel.deleteBook(*adapter.selectedBooks.toTypedArray()) }
noButton { } noButton { }
}.show().applyTint() }.show().applyTint()
@ -184,7 +184,7 @@ class ArrangeBookActivity : VMBaseActivity<ArrangeBookViewModel>(R.layout.activi
} }
override fun deleteBook(book: Book) { override fun deleteBook(book: Book) {
alert(titleResource = R.string.sure, messageResource = R.string.sure_del) { alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { okButton {
viewModel.deleteBook(book) viewModel.deleteBook(book)
} }

@ -171,7 +171,7 @@ class BookSourceActivity : VMBaseActivity<BookSourceViewModel>(R.layout.activity
override fun onClickMainAction() { override fun onClickMainAction() {
this@BookSourceActivity this@BookSourceActivity
.alert(titleResource = R.string.sure, messageResource = R.string.sure_del) { .alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { viewModel.delSelection(adapter.getSelection()) } okButton { viewModel.delSelection(adapter.getSelection()) }
noButton { } noButton { }
} }

@ -111,7 +111,7 @@ class ReplaceRuleActivity : VMBaseActivity<ReplaceRuleViewModel>(R.layout.activi
override fun onClickMainAction() { override fun onClickMainAction() {
this@ReplaceRuleActivity this@ReplaceRuleActivity
.alert(titleResource = R.string.sure, messageResource = R.string.sure_del) { .alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { viewModel.delSelection(adapter.getSelection()) } okButton { viewModel.delSelection(adapter.getSelection()) }
noButton { } noButton { }
} }

@ -159,7 +159,7 @@ class RssSourceActivity : VMBaseActivity<RssSourceViewModel>(R.layout.activity_r
override fun onClickMainAction() { override fun onClickMainAction() {
this@RssSourceActivity this@RssSourceActivity
.alert(titleResource = R.string.sure, messageResource = R.string.sure_del) { .alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
okButton { viewModel.delSelection(adapter.getSelection()) } okButton { viewModel.delSelection(adapter.getSelection()) }
noButton { } noButton { }
} }

@ -24,7 +24,7 @@
<string name="dynamic_click_retry">点击重试</string> <string name="dynamic_click_retry">点击重试</string>
<string name="dynamic_loading">正在加载</string> <string name="dynamic_loading">正在加载</string>
<string name="draw">提醒</string>
<string name="edit">编辑</string> <string name="edit">编辑</string>
<string name="delete">删除</string> <string name="delete">删除</string>
<string name="replace">替换</string> <string name="replace">替换</string>

Loading…
Cancel
Save