|
|
|
@ -20,6 +20,7 @@ import io.legado.app.constant.PreferKey |
|
|
|
|
import io.legado.app.constant.Status |
|
|
|
|
import io.legado.app.data.entities.Book |
|
|
|
|
import io.legado.app.data.entities.BookChapter |
|
|
|
|
import io.legado.app.data.entities.BookProgress |
|
|
|
|
import io.legado.app.help.ReadBookConfig |
|
|
|
|
import io.legado.app.help.ReadTipConfig |
|
|
|
|
import io.legado.app.help.storage.Backup |
|
|
|
@ -108,6 +109,9 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
upMenu() |
|
|
|
|
upView() |
|
|
|
|
} |
|
|
|
|
viewModel.processLiveData.observe(this) { |
|
|
|
|
sureSyncProgress(it) |
|
|
|
|
} |
|
|
|
|
viewModel.initData(intent) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -218,10 +222,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
binding.readView.upPageAnim() |
|
|
|
|
} |
|
|
|
|
R.id.menu_book_info -> ReadBook.book?.let { |
|
|
|
|
startActivity<BookInfoActivity>( |
|
|
|
|
Pair("name", it.name), |
|
|
|
|
Pair("author", it.author) |
|
|
|
|
) |
|
|
|
|
startActivity<BookInfoActivity>(Pair("name", it.name), Pair("author", it.author)) |
|
|
|
|
} |
|
|
|
|
R.id.menu_toc_regex -> TocRegexDialog.show( |
|
|
|
|
supportFragmentManager, |
|
|
|
@ -730,6 +731,16 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun sureSyncProgress(progress: BookProgress) { |
|
|
|
|
alert(R.string.get_book_progress) { |
|
|
|
|
message = getString(R.string.current_progress_exceeds_cloud) |
|
|
|
|
okButton { |
|
|
|
|
ReadBook.upProgress(progress) |
|
|
|
|
} |
|
|
|
|
noButton() |
|
|
|
|
}.show() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
|
super.onActivityResult(requestCode, resultCode, data) |
|
|
|
|
if (resultCode == Activity.RESULT_OK) { |
|
|
|
|