pull/46/head
kunfei 5 years ago
parent db50ec125a
commit 61a5cbe12a
  1. 10
      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 androidx.recyclerview.widget.LinearLayoutManager
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.VMBaseActivity 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.Book
import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.BookChapter
import io.legado.app.help.ImageLoader import io.legado.app.help.ImageLoader
import io.legado.app.help.IntentDataHelp import io.legado.app.help.IntentDataHelp
import io.legado.app.lib.theme.ATH 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.info.edit.BookInfoEditActivity
import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.book.read.ReadBookActivity
import io.legado.app.ui.book.source.edit.BookSourceEditActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity
@ -222,12 +224,18 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
} }
private fun startReadActivity(book: Book) { private fun startReadActivity(book: Book) {
startActivity<ReadBookActivity>( when (book.type) {
BookType.audio -> startActivity<AudioPlayActivity>(
Pair("bookUrl", book.bookUrl),
Pair("inBookshelf", viewModel.inBookshelf)
)
else -> startActivity<ReadBookActivity>(
Pair("bookUrl", book.bookUrl), Pair("bookUrl", book.bookUrl),
Pair("inBookshelf", viewModel.inBookshelf), Pair("inBookshelf", viewModel.inBookshelf),
Pair("key", IntentDataHelp.putData(book)) Pair("key", IntentDataHelp.putData(book))
) )
} }
}
override val curOrigin: String? override val curOrigin: String?
get() = viewModel.bookData.value?.origin get() = viewModel.bookData.value?.origin

Loading…
Cancel
Save