mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
fdb649a27c
commit
77711af564
@ -1377,9 +1377,16 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
|
||||
/* 全文搜索跳转 */
|
||||
private fun skipToSearch(searchResult: SearchResult) {
|
||||
val previousResult = binding.searchMenu.previousSearchResult
|
||||
if (searchResult.chapterIndex != ReadBook.durChapterIndex) {
|
||||
viewModel.openChapter(searchResult.chapterIndex) {
|
||||
jumpToPosition(searchResult)
|
||||
}
|
||||
} else {
|
||||
jumpToPosition(searchResult)
|
||||
}
|
||||
}
|
||||
|
||||
fun jumpToPosition() {
|
||||
private fun jumpToPosition(searchResult: SearchResult) {
|
||||
val curTextChapter = ReadBook.curTextChapter ?: return
|
||||
binding.searchMenu.updateSearchInfo()
|
||||
val (pageIndex, lineIndex, charIndex, addLine, charIndex2) =
|
||||
@ -1405,15 +1412,6 @@ class ReadBookActivity : BaseReadBookActivity(),
|
||||
}
|
||||
}
|
||||
|
||||
if (searchResult.chapterIndex != previousResult?.chapterIndex) {
|
||||
viewModel.openChapter(searchResult.chapterIndex) {
|
||||
jumpToPosition()
|
||||
}
|
||||
} else {
|
||||
jumpToPosition()
|
||||
}
|
||||
}
|
||||
|
||||
override fun addBookmark() {
|
||||
val book = ReadBook.book
|
||||
val page = ReadBook.curTextChapter?.getPage(ReadBook.durPageIndex)
|
||||
|
Loading…
Reference in New Issue
Block a user