From 48e7d49ae7b6835576cfad7fc904d624ad8807cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8F=A3=E5=8F=A3=E5=90=95?= <156081428@qq.com>
Date: Wed, 16 Sep 2020 09:14:30 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/ui/book/explore/ExploreShowAdapter.kt | 6 +++++-
.../app/ui/book/search/SearchAdapter.kt | 19 ++++++++++++++++---
.../app/ui/main/explore/ExploreAdapter.kt | 11 ++++-------
app/src/main/res/values-zh-rHK/strings.xml | 1 +
app/src/main/res/values-zh-rTW/strings.xml | 1 +
app/src/main/res/values-zh/strings.xml | 1 +
app/src/main/res/values/strings.xml | 1 +
7 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt
index 322e4a7a3..1118eb8cc 100644
--- a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt
+++ b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowAdapter.kt
@@ -26,7 +26,11 @@ class ExploreShowAdapter(context: Context, val callBack: CallBack) :
tv_lasted.text = context.getString(R.string.lasted_show, item.latestChapterTitle)
tv_lasted.visible()
}
- tv_introduce.text = context.getString(R.string.intro_show, item.intro)
+ if (item.intro.isNullOrEmpty()) {
+ tv_introduce.text = context.getString(R.string.intro_show_null)
+ } else {
+ tv_introduce.text = context.getString(R.string.intro_show, item.intro)
+ }
val kinds = item.getKindList()
if (kinds.isEmpty()) {
ll_kind.gone()
diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt
index a96244113..4370e9697 100644
--- a/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt
+++ b/app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt
@@ -42,7 +42,13 @@ class SearchAdapter(context: Context, val callBack: CallBack) :
tv_author.text = context.getString(R.string.author_show, searchBook.author)
bv_originCount.setBadgeCount(searchBook.origins.size)
upLasted(itemView, searchBook.latestChapterTitle)
- tv_introduce.text = context.getString(R.string.intro_show, searchBook.intro)
+ if (searchBook.intro.isNullOrEmpty()) {
+ tv_introduce.text =
+ context.getString(R.string.intro_show_null)
+ } else {
+ tv_introduce.text =
+ context.getString(R.string.intro_show, searchBook.intro)
+ }
upKind(itemView, searchBook.getKindList())
iv_cover.load(searchBook.coverUrl, searchBook.name, searchBook.author)
@@ -58,8 +64,15 @@ class SearchAdapter(context: Context, val callBack: CallBack) :
context.getString(R.string.author_show, searchBook.author)
"origins" -> bv_originCount.setBadgeCount(searchBook.origins.size)
"last" -> upLasted(itemView, searchBook.latestChapterTitle)
- "intro" -> tv_introduce.text =
- context.getString(R.string.intro_show, searchBook.intro)
+ "intro" -> {
+ if (searchBook.intro.isNullOrEmpty()) {
+ tv_introduce.text =
+ context.getString(R.string.intro_show_null)
+ } else {
+ tv_introduce.text =
+ context.getString(R.string.intro_show, searchBook.intro)
+ }
+ }
"kind" -> upKind(itemView, searchBook.getKindList())
"cover" -> iv_cover.load(
searchBook.coverUrl,
diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
index ccfa5bf82..0fdfa373f 100644
--- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
+++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
@@ -11,10 +11,7 @@ import io.legado.app.base.adapter.SimpleRecyclerAdapter
import io.legado.app.data.entities.BookSource
import io.legado.app.help.coroutine.Coroutine
import io.legado.app.lib.theme.accentColor
-import io.legado.app.utils.ACache
-import io.legado.app.utils.dp
-import io.legado.app.utils.gone
-import io.legado.app.utils.visible
+import io.legado.app.utils.*
import kotlinx.android.synthetic.main.item_fillet_text.view.*
import kotlinx.android.synthetic.main.item_find_book.view.*
import kotlinx.coroutines.CoroutineScope
@@ -55,12 +52,12 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
.inflate(R.layout.item_fillet_text, gl_child, false)
gl_child.addView(tv)
tv.text_view.text = kind.title
- tv.text_view.onClick {
- kind.url?.let { kindUrl ->
+ if (!kind.url.isNullOrEmpty()) {
+ tv.text_view.onClick {
callBack.openExplore(
item.bookSourceUrl,
kind.title,
- kindUrl
+ kind.url.toString()
)
}
}
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index c585ffb97..7eb76aee8 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -223,6 +223,7 @@
載入失敗,點擊重試
內容簡介
簡介: %s
+ 簡介: 暫無簡介
打開外部書籍
來源: %s
本地導入
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 006b4ff45..11101e7eb 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -223,6 +223,7 @@
載入失敗,點擊重試
內容簡介
簡介:%s
+ 簡介: 暫無簡介
打開外部書籍
來源: %s
本機匯入
diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml
index 78487a2be..6052fe4f5 100644
--- a/app/src/main/res/values-zh/strings.xml
+++ b/app/src/main/res/values-zh/strings.xml
@@ -225,6 +225,7 @@
加载失败,点击重试
内容简介
简介:%s
+ 简介: 暂无简介
打开外部书籍
来源: %s
本地导入
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 893230b30..89c65602e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -225,6 +225,7 @@
Load failed, tap to retry
Book description
Description:%s
+ Description: no introduction
Open external book
Origin: %s
Import local rules