修复阅读界面加入书架后,书籍详情页还是显示加入书架按钮的bug

pull/300/head
gedoor 4 years ago
parent 642b13753e
commit 2776b1dec4
  1. 5
      app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt

@ -153,7 +153,10 @@ class AudioPlayActivity :
if (!AudioPlay.inBookshelf) { if (!AudioPlay.inBookshelf) {
this.alert(title = getString(R.string.add_to_shelf)) { this.alert(title = getString(R.string.add_to_shelf)) {
message = getString(R.string.check_add_bookshelf, it.name) message = getString(R.string.check_add_bookshelf, it.name)
okButton { AudioPlay.inBookshelf = true } okButton {
AudioPlay.inBookshelf = true
setResult(Activity.RESULT_OK)
}
noButton { viewModel.removeFromBookshelf { super.finish() } } noButton { viewModel.removeFromBookshelf { super.finish() } }
}.show().applyTint() }.show().applyTint()
} else { } else {

@ -306,7 +306,8 @@ class BookInfoActivity :
private fun startReadActivity(book: Book) { private fun startReadActivity(book: Book) {
when (book.type) { when (book.type) {
BookType.audio -> startActivity<AudioPlayActivity>( BookType.audio -> startActivityForResult<AudioPlayActivity>(
requestCodeRead,
Pair("bookUrl", book.bookUrl), Pair("bookUrl", book.bookUrl),
Pair("inBookshelf", viewModel.inBookshelf) Pair("inBookshelf", viewModel.inBookshelf)
) )

Loading…
Cancel
Save