From 61a5cbe12aecdc8186dc4758291655097123252e Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 4 Nov 2019 10:48:40 +0800 Subject: [PATCH] up --- .../app/ui/book/info/BookInfoActivity.kt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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 4ea63281d..53890274b 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 @@ -8,11 +8,13 @@ import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.R import io.legado.app.base.VMBaseActivity +import io.legado.app.constant.BookType import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.help.ImageLoader import io.legado.app.help.IntentDataHelp import io.legado.app.lib.theme.ATH +import io.legado.app.ui.audio.AudioPlayActivity import io.legado.app.ui.book.info.edit.BookInfoEditActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity @@ -222,11 +224,17 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo } private fun startReadActivity(book: Book) { - startActivity( - Pair("bookUrl", book.bookUrl), - Pair("inBookshelf", viewModel.inBookshelf), - Pair("key", IntentDataHelp.putData(book)) - ) + when (book.type) { + BookType.audio -> startActivity( + Pair("bookUrl", book.bookUrl), + Pair("inBookshelf", viewModel.inBookshelf) + ) + else -> startActivity( + Pair("bookUrl", book.bookUrl), + Pair("inBookshelf", viewModel.inBookshelf), + Pair("key", IntentDataHelp.putData(book)) + ) + } } override val curOrigin: String?