From 02d5cb36dd402a6528d8f0999ba3fb387f4a8a9c Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 25 Oct 2019 22:27:26 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/main/bookshelf/BooksFragment.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt index 3a4657dbf..41278ab9e 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BooksFragment.kt @@ -11,10 +11,12 @@ import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseFragment +import io.legado.app.constant.BookType import io.legado.app.constant.Bus import io.legado.app.data.entities.Book import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.accentColor +import io.legado.app.ui.audio.AudioPlayActivity import io.legado.app.ui.book.info.BookInfoActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.main.MainViewModel @@ -95,7 +97,11 @@ class BooksFragment : VMBaseFragment(R.layout.fragment_books), } override fun open(book: Book) { - context?.startActivity(Pair("bookUrl", book.bookUrl)) + when (book.type) { + BookType.audio -> + context?.startActivity(Pair("bookUrl", book.bookUrl)) + else -> context?.startActivity(Pair("bookUrl", book.bookUrl)) + } } override fun openBookInfo(book: Book) {