|
@@ -125,6 +125,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
viewModel.searchResultIndex = index
|
|
viewModel.searchResultIndex = index
|
|
|
binding.searchMenu.updateSearchResultIndex(index)
|
|
binding.searchMenu.updateSearchResultIndex(index)
|
|
|
binding.searchMenu.selectedSearchResult?.let { currentResult ->
|
|
binding.searchMenu.selectedSearchResult?.let { currentResult ->
|
|
|
|
|
+ ReadBook.saveCurrentBookProcess() //退出全文搜索恢复此时进度
|
|
|
skipToSearch(currentResult)
|
|
skipToSearch(currentResult)
|
|
|
showActionMenu()
|
|
showActionMenu()
|
|
|
}
|
|
}
|
|
@@ -493,6 +494,11 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
keyCode == KeyEvent.KEYCODE_BACK -> {
|
|
keyCode == KeyEvent.KEYCODE_BACK -> {
|
|
|
if (isShowingSearchResult) {
|
|
if (isShowingSearchResult) {
|
|
|
exitSearchMenu()
|
|
exitSearchMenu()
|
|
|
|
|
+ restoreLastBookProcess()
|
|
|
|
|
+ return true
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ReadBook.lastBookPress != null) {
|
|
|
|
|
+ restoreLastBookProcess()
|
|
|
return true
|
|
return true
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -977,6 +983,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
upNavigationBarColor()
|
|
upNavigationBarColor()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 退出全文搜索
|
|
|
override fun exitSearchMenu() {
|
|
override fun exitSearchMenu() {
|
|
|
if (isShowingSearchResult) {
|
|
if (isShowingSearchResult) {
|
|
|
isShowingSearchResult = false
|
|
isShowingSearchResult = false
|
|
@@ -987,6 +994,19 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /* 恢复到 全文搜索/进度条跳转前的位置 */
|
|
|
|
|
+ private fun restoreLastBookProcess() {
|
|
|
|
|
+ alert(R.string.draw) {
|
|
|
|
|
+ setMessage(R.string.restore_last_book_process)
|
|
|
|
|
+ yesButton {
|
|
|
|
|
+ ReadBook.restoreLastBookProcess() //恢复启动全文搜索前的进度
|
|
|
|
|
+ }
|
|
|
|
|
+ noButton {
|
|
|
|
|
+ ReadBook.lastBookPress = null
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
override fun showLogin() {
|
|
override fun showLogin() {
|
|
|
ReadBook.bookSource?.let {
|
|
ReadBook.bookSource?.let {
|
|
|
startActivity<SourceLoginActivity> {
|
|
startActivity<SourceLoginActivity> {
|
|
@@ -1134,8 +1154,6 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /* 回复到 全文搜索/进度条跳转前的位置 */
|
|
|
|
|
-
|
|
|
|
|
/* 进度条跳转到指定章节 */
|
|
/* 进度条跳转到指定章节 */
|
|
|
override fun skipToChapter(index: Int) {
|
|
override fun skipToChapter(index: Int) {
|
|
|
viewModel.openChapter(index)
|
|
viewModel.openChapter(index)
|