Update ReadBookActivity.kt

pull/374/head
Jason Yao 4 years ago
parent ce09240e4f
commit c32e02e56a
  1. 5
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -781,10 +781,11 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
val query = data.getStringExtra("query")
viewModel.openChapter(index)
// block until load correct chapter and pages
while (ReadBook.durChapterIndex != index || ReadBook.curTextChapter?.pages == null ){
var pages = ReadBook.curTextChapter?.pages
while (ReadBook.durChapterIndex != index || pages == null ){
delay(100L)
pages = ReadBook.curTextChapter?.pages
}
val pages = ReadBook.curTextChapter?.pages
val positions = ReadBook.searchResultPositions(pages, indexWithinChapter, query!!)
//todo: show selected text
val job1 = async(Main){

Loading…
Cancel
Save