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