pull/977/head
gedoor 4 years ago
parent cd3f352c92
commit 53d51c8123
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -89,12 +89,14 @@ class ReadBookActivity : ReadBookBaseActivity(),
} }
private val replaceActivity = private val replaceActivity =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
it ?: return@registerForActivityResult
if (it.resultCode == RESULT_OK) { if (it.resultCode == RESULT_OK) {
viewModel.replaceRuleChanged() viewModel.replaceRuleChanged()
} }
} }
private val searchContentActivity = private val searchContentActivity =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
it ?: return@registerForActivityResult
it.data?.let { data -> it.data?.let { data ->
data.getIntExtra("index", ReadBook.durChapterIndex).let { index -> data.getIntExtra("index", ReadBook.durChapterIndex).let { index ->
viewModel.searchContentQuery = data.getStringExtra("query") ?: "" viewModel.searchContentQuery = data.getStringExtra("query") ?: ""

Loading…
Cancel
Save