From 0383af9997d348a775222d7ab5f326a083ac6ffa Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 21 Jun 2022 21:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/remote/RemoteBookActivity.kt | 17 ++++++++++++++ .../app/ui/book/remote/RemoteBookAdapter.kt | 23 ++++++++++--------- .../main/res/layout/activity_remote_book.xml | 2 +- app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-ja-rJP/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + 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 + 10 files changed, 37 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt index dab1affdd..8e4e171ca 100644 --- a/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt @@ -70,6 +70,23 @@ class RemoteBookActivity : VMBaseActivity(context){ +class RemoteBookAdapter(context: Context, val callBack: CallBack) : + RecyclerAdapter(context) { override fun getViewBinding(parent: ViewGroup): ItemRemoteBookBinding { return ItemRemoteBookBinding.inflate(inflater, parent, false) @@ -47,17 +47,18 @@ class RemoteBookAdapter (context: Context, val callBack: CallBack) : } override fun registerListener(holder: ItemViewHolder, binding: ItemRemoteBookBinding) { - - binding.btnDownload.setOnClickListener { - getItem(holder.layoutPosition)?.let { - if (it.isDir) { - callBack.openDir(it) - } else { - callBack.addToBookshelf(it) - } + binding.root.setOnClickListener { + getItem(holder.layoutPosition)?.let { + if (it.isDir) { + callBack.openDir(it) } + } + } + binding.btnDownload.setOnClickListener { + getItem(holder.layoutPosition)?.let { + callBack.addToBookshelf(it) + } } - } interface CallBack { diff --git a/app/src/main/res/layout/activity_remote_book.xml b/app/src/main/res/layout/activity_remote_book.xml index 35b5353d8..90280ac77 100644 --- a/app/src/main/res/layout/activity_remote_book.xml +++ b/app/src/main/res/layout/activity_remote_book.xml @@ -10,7 +10,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" app:layout_constraintTop_toTopOf="parent" - app:title="远程书籍" /> + app:title="@string/remote_book" /> Fail to decode bitmap Image url is empty, check replacement rules 变量说明(variableComment) + 远程书籍 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 324995eb8..a1a09f6f7 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -999,4 +999,5 @@ Fail to decode bitmap Image url is empty, check replacement rules 变量说明(variableComment) + 远程书籍 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 6fae8a053..a3d9f12c5 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -999,4 +999,5 @@ Fail to decode bitmap Image url is empty, check replacement rules 变量说明(variableComment) + 远程书籍 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 8afa0fb70..8bd464fcb 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -996,4 +996,5 @@ 图片解码失败 图片链接为空,检查替换净化规则 变量说明(variableComment) + 远程书籍 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 2958a2c5a..9ac815bf4 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -998,4 +998,5 @@ 图片解码失败 图片链接为空,检查替换净化规则 变量说明(variableComment) + 远程书籍 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index c9bb20512..6fd055716 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -998,4 +998,5 @@ 图片解码失败 图片链接为空,检查替换净化规则 变量说明(variableComment) + 远程书籍 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c81e399db..d32d7d058 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -999,4 +999,5 @@ Fail to decode bitmap Image url is empty, check replacement rules 变量说明(variableComment) + 远程书籍