From e292988101a7cdf28349083859a7531cd247abe9 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 4 Dec 2019 09:16:40 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/book/read/ReadBookActivity.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 5fb7e5434..9e584ca86 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 @@ -46,7 +46,6 @@ import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import org.jetbrains.anko.sdk27.listeners.onClick -import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.toast @@ -62,6 +61,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo private val requestCodeChapterList = 568 private val requestCodeEditSource = 111 + private val requestCodeReplace = 31242 private var timeElectricityReceiver: TimeElectricityReceiver? = null override fun onActivityCreated(savedInstanceState: Bundle?) { @@ -310,10 +310,16 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } + /** + * 替换 + */ override fun openReplaceRule() { - startActivity() + startActivityForResult(requestCodeReplace) } + /** + * 打开目录 + */ override fun openChapterList() { ReadBook.book?.let { startActivityForResult( @@ -377,6 +383,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo data?.getIntExtra("index", ReadBook.durChapterIndex)?.let { viewModel.openChapter(it) } + requestCodeReplace -> ReadBook.loadContent() } } }