From 99ba9a265d2b8fdbb9ae442e5ad5009c9dd2c7ff Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 12 Aug 2019 10:07:54 +0800 Subject: [PATCH] up --- .../java/io/legado/app/data/entities/Book.kt | 1 + .../java/io/legado/app/help/storage/Restore.kt | 6 +++--- .../legado/app/ui/bookinfo/BookInfoActivity.kt | 2 +- app/src/main/res/layout/activity_book_info.xml | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/entities/Book.kt b/app/src/main/java/io/legado/app/data/entities/Book.kt index 4d08f9dcb..02c751114 100644 --- a/app/src/main/java/io/legado/app/data/entities/Book.kt +++ b/app/src/main/java/io/legado/app/data/entities/Book.kt @@ -20,6 +20,7 @@ data class Book( var bookUrl: String = "", // 详情页Url(本地书源存储完整文件路径) var tocUrl: String = "", // 目录页Url (toc=table of Contents) var origin: String = BookType.local, // 书源URL(默认BookType.local) + var originName: String = "", //书源名称 var name: String? = null, // 书籍名称(书源获取) var author: String? = null, // 作者名称(书源获取) var kind: String? = null, // 分类信息(书源获取) diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index 7eb6c1411..c10908dcd 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -52,7 +52,8 @@ object Restore { Log.d(AppConst.APP_TAG, "Found existing book: ${book.name}") 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.type = if (jsonItem.readString("$.bookInfoBean.bookSourceType") == "AUDIO") 1 else 0 book.tocUrl = jsonItem.readString("$.bookInfoBean.chapterUrl") ?: book.bookUrl @@ -66,8 +67,7 @@ object Restore { book.durChapterPos = jsonItem.readInt("$.durChapterPage") ?: 0 book.durChapterTime = jsonItem.readLong("$.finalDate") ?: 0 book.group = jsonItem.readInt("$.group") ?: 0 - // book. = jsonItem.readString("$.hasUpdate") - // book. = jsonItem.readString("$.isLoading") + book.intro = jsonItem.readString("$.bookInfoBean.introduce") book.latestChapterTitle = jsonItem.readString("$.lastChapterName") book.lastCheckCount = jsonItem.readInt("$.newChapters") ?: 0 book.order = jsonItem.readInt("$.serialNumber") ?: 0 diff --git a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt index 91e2d73a4..6b27b6562 100644 --- a/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/bookinfo/BookInfoActivity.kt @@ -21,7 +21,7 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo private fun showBook(book: Book) { tv_name.text = book.name tv_author.text = book.author - tv_origin.text = book.origin + tv_origin.text = book.originName tv_lasted.text = book.latestChapterTitle tv_intro.text = book.getDisplayIntro() book.getDisplayCover()?.let { diff --git a/app/src/main/res/layout/activity_book_info.xml b/app/src/main/res/layout/activity_book_info.xml index 80d451fe6..760019f21 100644 --- a/app/src/main/res/layout/activity_book_info.xml +++ b/app/src/main/res/layout/activity_book_info.xml @@ -66,13 +66,22 @@ android:layout_width="match_parent" android:layout_height="80dp" android:layout_margin="10dp" + android:scrollbars="vertical" + android:textIsSelectable="true" + app:layout_constraintTop_toBottomOf="@+id/iv_cover" /> + + + +