diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 6740f3169..09d29a7f3 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -558,8 +558,10 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo * 替换规则变化 */ override fun onReplaceRuleSave() { - Coroutine.async { BookHelp.upReplaceRules() } - ReadBook.loadContent() + Coroutine.async { + BookHelp.upReplaceRules() + ReadBook.loadContent() + } } /** @@ -637,7 +639,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo viewModel.openChapter(index) } } - requestCodeReplace -> ReadBook.loadContent() + requestCodeReplace -> onReplaceRuleSave() } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt index 4dc9ba7da..7e90c7ad1 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt @@ -95,6 +95,7 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac onMenuItemSelected(it) } } + callBack.onMenuActionFinally() } } } @@ -121,7 +122,6 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac } } } - callBack.onMenuActionFinally() } @RequiresApi(Build.VERSION_CODES.M) diff --git a/app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditDialog.kt b/app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditDialog.kt index f4226a64e..d125674c5 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditDialog.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/edit/ReplaceEditDialog.kt @@ -102,7 +102,7 @@ class ReplaceEditDialog : DialogFragment(), return replaceRule } - val callBack = activity as? CallBack + val callBack get() = activity as? CallBack interface CallBack { fun onReplaceRuleSave()