mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
cbeba42b36
commit
69c32bb6ff
@ -68,7 +68,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
|
||||
recyclerView.adapter = adapter
|
||||
readRecord.tvRemove.setOnClickListener {
|
||||
alert(R.string.delete, R.string.sure_del) {
|
||||
okButton {
|
||||
yesButton {
|
||||
appDb.readRecordDao.clear()
|
||||
initData()
|
||||
}
|
||||
@ -144,7 +144,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
|
||||
private fun sureDelAlert(item: ReadRecordShow) {
|
||||
alert(R.string.delete) {
|
||||
setMessage(getString(R.string.sure_del_any, item.bookName))
|
||||
okButton {
|
||||
yesButton {
|
||||
appDb.readRecordDao.deleteByName(item.bookName)
|
||||
initData()
|
||||
}
|
||||
|
@ -94,10 +94,10 @@ class FileAssociationActivity :
|
||||
title = appCtx.getString(R.string.draw),
|
||||
message = appCtx.getString(R.string.file_not_supported, data.second)
|
||||
) {
|
||||
okButton {
|
||||
yesButton {
|
||||
importBook(data.first)
|
||||
}
|
||||
cancelButton {
|
||||
noButton {
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
@ -183,7 +183,7 @@ class ImportBookSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_vie
|
||||
}
|
||||
}
|
||||
}
|
||||
noButton()
|
||||
cancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ class ImportRssSourceDialog() : BaseDialogFragment(R.layout.dialog_recycler_view
|
||||
}
|
||||
}
|
||||
}
|
||||
noButton()
|
||||
cancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,8 @@ class ChangeChapterSourceDialog() : BaseDialogFragment(R.layout.dialog_chapter_c
|
||||
launch {
|
||||
alert("搜索结果为空") {
|
||||
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
|
||||
cancelButton()
|
||||
okButton {
|
||||
noButton()
|
||||
yesButton {
|
||||
AppConfig.searchGroup = ""
|
||||
viewModel.startSearch()
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ class GroupEditDialog() : BaseDialogFragment(R.layout.dialog_book_group_edit) {
|
||||
|
||||
private fun deleteGroup(ok: () -> Unit) {
|
||||
alert(R.string.delete, R.string.sure_del) {
|
||||
okButton {
|
||||
yesButton {
|
||||
ok.invoke()
|
||||
}
|
||||
noButton()
|
||||
|
@ -72,8 +72,8 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
||||
launch {
|
||||
alert("搜索结果为空") {
|
||||
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
|
||||
cancelButton()
|
||||
okButton {
|
||||
noButton()
|
||||
yesButton {
|
||||
AppConfig.searchGroup = ""
|
||||
viewModel.searchKey = ""
|
||||
viewModel.search(searchView.query.toString())
|
||||
|
@ -72,7 +72,7 @@ class ThemeListDialog : BaseDialogFragment(R.layout.dialog_recycler_view),
|
||||
|
||||
fun delete(index: Int) {
|
||||
alert(R.string.delete, R.string.sure_del) {
|
||||
okButton {
|
||||
yesButton {
|
||||
ThemeConfig.delConfig(index)
|
||||
initData()
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package io.legado.app.ui.main.bookshelf
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import androidx.fragment.app.activityViewModels
|
||||
@ -166,7 +165,7 @@ abstract class BaseBookshelfFragment(layoutId: Int) : VMBaseFragment<BookshelfVi
|
||||
}
|
||||
}
|
||||
}
|
||||
noButton()
|
||||
cancelButton()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ class RssSourceActivity : VMBaseActivity<ActivityRssSourceBinding, RssSourceView
|
||||
|
||||
private fun delSourceDialog() {
|
||||
alert(titleResource = R.string.draw, messageResource = R.string.sure_del) {
|
||||
okButton { viewModel.del(*adapter.selection.toTypedArray()) }
|
||||
yesButton { viewModel.del(*adapter.selection.toTypedArray()) }
|
||||
noButton()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user