From 2776b1dec4d92037df4a09bdd798e2226135996e Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 9 Aug 2020 10:01:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=98=85=E8=AF=BB=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8A=A0=E5=85=A5=E4=B9=A6=E6=9E=B6=E5=90=8E,?= =?UTF-8?q?=E4=B9=A6=E7=B1=8D=E8=AF=A6=E6=83=85=E9=A1=B5=E8=BF=98=E6=98=AF?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=8A=A0=E5=85=A5=E4=B9=A6=E6=9E=B6=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/audio/AudioPlayActivity.kt | 5 ++++- .../main/java/io/legado/app/ui/book/info/BookInfoActivity.kt | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index 6041de8f5..2a339f46d 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -153,7 +153,10 @@ class AudioPlayActivity : if (!AudioPlay.inBookshelf) { this.alert(title = getString(R.string.add_to_shelf)) { 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() } } }.show().applyTint() } else { diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index e94dab3b8..9f61755eb 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -306,7 +306,8 @@ class BookInfoActivity : private fun startReadActivity(book: Book) { when (book.type) { - BookType.audio -> startActivity( + BookType.audio -> startActivityForResult( + requestCodeRead, Pair("bookUrl", book.bookUrl), Pair("inBookshelf", viewModel.inBookshelf) )