pull/32/head
kunfei 5 years ago
parent 2fd8c5f278
commit 99ba9a265d
  1. 1
      app/src/main/java/io/legado/app/data/entities/Book.kt
  2. 6
      app/src/main/java/io/legado/app/help/storage/Restore.kt
  3. 2
      app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt
  4. 16
      app/src/main/res/layout/activity_book_info.xml

@ -20,6 +20,7 @@ data class Book(
var bookUrl: String = "", // 详情页Url(本地书源存储完整文件路径) var bookUrl: String = "", // 详情页Url(本地书源存储完整文件路径)
var tocUrl: String = "", // 目录页Url (toc=table of Contents) var tocUrl: String = "", // 目录页Url (toc=table of Contents)
var origin: String = BookType.local, // 书源URL(默认BookType.local) var origin: String = BookType.local, // 书源URL(默认BookType.local)
var originName: String = "", //书源名称
var name: String? = null, // 书籍名称(书源获取) var name: String? = null, // 书籍名称(书源获取)
var author: String? = null, // 作者名称(书源获取) var author: String? = null, // 作者名称(书源获取)
var kind: String? = null, // 分类信息(书源获取) var kind: String? = null, // 分类信息(书源获取)

@ -52,7 +52,8 @@ object Restore {
Log.d(AppConst.APP_TAG, "Found existing book: ${book.name}") Log.d(AppConst.APP_TAG, "Found existing book: ${book.name}")
continue continue
} }
book.origin = jsonItem.readString("$.bookInfoBean.tag") ?: "" book.origin = jsonItem.readString("$.tag") ?: ""
book.originName = jsonItem.readString("$.bookInfoBean.origin") ?: ""
book.author = jsonItem.readString("$.bookInfoBean.author") book.author = jsonItem.readString("$.bookInfoBean.author")
book.type = if (jsonItem.readString("$.bookInfoBean.bookSourceType") == "AUDIO") 1 else 0 book.type = if (jsonItem.readString("$.bookInfoBean.bookSourceType") == "AUDIO") 1 else 0
book.tocUrl = jsonItem.readString("$.bookInfoBean.chapterUrl") ?: book.bookUrl book.tocUrl = jsonItem.readString("$.bookInfoBean.chapterUrl") ?: book.bookUrl
@ -66,8 +67,7 @@ object Restore {
book.durChapterPos = jsonItem.readInt("$.durChapterPage") ?: 0 book.durChapterPos = jsonItem.readInt("$.durChapterPage") ?: 0
book.durChapterTime = jsonItem.readLong("$.finalDate") ?: 0 book.durChapterTime = jsonItem.readLong("$.finalDate") ?: 0
book.group = jsonItem.readInt("$.group") ?: 0 book.group = jsonItem.readInt("$.group") ?: 0
// book. = jsonItem.readString("$.hasUpdate") book.intro = jsonItem.readString("$.bookInfoBean.introduce")
// book. = jsonItem.readString("$.isLoading")
book.latestChapterTitle = jsonItem.readString("$.lastChapterName") book.latestChapterTitle = jsonItem.readString("$.lastChapterName")
book.lastCheckCount = jsonItem.readInt("$.newChapters") ?: 0 book.lastCheckCount = jsonItem.readInt("$.newChapters") ?: 0
book.order = jsonItem.readInt("$.serialNumber") ?: 0 book.order = jsonItem.readInt("$.serialNumber") ?: 0

@ -21,7 +21,7 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
private fun showBook(book: Book) { private fun showBook(book: Book) {
tv_name.text = book.name tv_name.text = book.name
tv_author.text = book.author tv_author.text = book.author
tv_origin.text = book.origin tv_origin.text = book.originName
tv_lasted.text = book.latestChapterTitle tv_lasted.text = book.latestChapterTitle
tv_intro.text = book.getDisplayIntro() tv_intro.text = book.getDisplayIntro()
book.getDisplayCover()?.let { book.getDisplayCover()?.let {

@ -66,13 +66,22 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="80dp" android:layout_height="80dp"
android:layout_margin="10dp" android:layout_margin="10dp"
android:scrollbars="vertical"
android:textIsSelectable="true"
app:layout_constraintTop_toBottomOf="@+id/iv_cover" />
<View
android:id="@+id/view_shadow"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/bg_shadow_top"
app:layout_constraintTop_toBottomOf="@+id/iv_cover" /> app:layout_constraintTop_toBottomOf="@+id/iv_cover" />
<LinearLayout <LinearLayout
android:id="@+id/ll_chapter_base_info" android:id="@+id/ll_chapter_base_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="36dp" android:layout_height="36dp"
android:layout_marginTop="10dp"
android:background="@color/background" android:background="@color/background"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingRight="10dp" android:paddingRight="10dp"
@ -81,6 +90,11 @@
android:orientation="horizontal" android:orientation="horizontal"
app:layout_constraintTop_toBottomOf="@+id/tv_intro"> app:layout_constraintTop_toBottomOf="@+id/tv_intro">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/chapter_list" />
<TextView <TextView
android:id="@+id/tv_current_chapter_info" android:id="@+id/tv_current_chapter_info"
android:layout_width="0dp" android:layout_width="0dp"

Loading…
Cancel
Save