优化
This commit is contained in:
@@ -68,7 +68,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
|
|||||||
recyclerView.adapter = adapter
|
recyclerView.adapter = adapter
|
||||||
readRecord.tvRemove.setOnClickListener {
|
readRecord.tvRemove.setOnClickListener {
|
||||||
alert(R.string.delete, R.string.sure_del) {
|
alert(R.string.delete, R.string.sure_del) {
|
||||||
okButton {
|
yesButton {
|
||||||
appDb.readRecordDao.clear()
|
appDb.readRecordDao.clear()
|
||||||
initData()
|
initData()
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ class ReadRecordActivity : BaseActivity<ActivityReadRecordBinding>() {
|
|||||||
private fun sureDelAlert(item: ReadRecordShow) {
|
private fun sureDelAlert(item: ReadRecordShow) {
|
||||||
alert(R.string.delete) {
|
alert(R.string.delete) {
|
||||||
setMessage(getString(R.string.sure_del_any, item.bookName))
|
setMessage(getString(R.string.sure_del_any, item.bookName))
|
||||||
okButton {
|
yesButton {
|
||||||
appDb.readRecordDao.deleteByName(item.bookName)
|
appDb.readRecordDao.deleteByName(item.bookName)
|
||||||
initData()
|
initData()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,10 +94,10 @@ class FileAssociationActivity :
|
|||||||
title = appCtx.getString(R.string.draw),
|
title = appCtx.getString(R.string.draw),
|
||||||
message = appCtx.getString(R.string.file_not_supported, data.second)
|
message = appCtx.getString(R.string.file_not_supported, data.second)
|
||||||
) {
|
) {
|
||||||
okButton {
|
yesButton {
|
||||||
importBook(data.first)
|
importBook(data.first)
|
||||||
}
|
}
|
||||||
cancelButton {
|
noButton {
|
||||||
finish()
|
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 {
|
launch {
|
||||||
alert("搜索结果为空") {
|
alert("搜索结果为空") {
|
||||||
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
|
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
|
||||||
cancelButton()
|
noButton()
|
||||||
okButton {
|
yesButton {
|
||||||
AppConfig.searchGroup = ""
|
AppConfig.searchGroup = ""
|
||||||
viewModel.startSearch()
|
viewModel.startSearch()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ class GroupEditDialog() : BaseDialogFragment(R.layout.dialog_book_group_edit) {
|
|||||||
|
|
||||||
private fun deleteGroup(ok: () -> Unit) {
|
private fun deleteGroup(ok: () -> Unit) {
|
||||||
alert(R.string.delete, R.string.sure_del) {
|
alert(R.string.delete, R.string.sure_del) {
|
||||||
okButton {
|
yesButton {
|
||||||
ok.invoke()
|
ok.invoke()
|
||||||
}
|
}
|
||||||
noButton()
|
noButton()
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ class SearchActivity : VMBaseActivity<ActivityBookSearchBinding, SearchViewModel
|
|||||||
launch {
|
launch {
|
||||||
alert("搜索结果为空") {
|
alert("搜索结果为空") {
|
||||||
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
|
setMessage("${searchGroup}分组搜索结果为空,是否切换到全部分组")
|
||||||
cancelButton()
|
noButton()
|
||||||
okButton {
|
yesButton {
|
||||||
AppConfig.searchGroup = ""
|
AppConfig.searchGroup = ""
|
||||||
viewModel.searchKey = ""
|
viewModel.searchKey = ""
|
||||||
viewModel.search(searchView.query.toString())
|
viewModel.search(searchView.query.toString())
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class ThemeListDialog : BaseDialogFragment(R.layout.dialog_recycler_view),
|
|||||||
|
|
||||||
fun delete(index: Int) {
|
fun delete(index: Int) {
|
||||||
alert(R.string.delete, R.string.sure_del) {
|
alert(R.string.delete, R.string.sure_del) {
|
||||||
okButton {
|
yesButton {
|
||||||
ThemeConfig.delConfig(index)
|
ThemeConfig.delConfig(index)
|
||||||
initData()
|
initData()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package io.legado.app.ui.main.bookshelf
|
package io.legado.app.ui.main.bookshelf
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Intent
|
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import androidx.fragment.app.activityViewModels
|
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() {
|
private fun delSourceDialog() {
|
||||||
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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user