From 684fb199db8c5d72510f3c1ae940a909b5b6fa73 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Thu, 12 May 2022 16:24:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=B7=BB=E5=8A=A0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E4=B9=A6=E6=BA=90(=E7=9F=A5=E8=BD=A9?= =?UTF-8?q?=E8=97=8F=E4=B9=A6=E7=B1=BB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/web/bookSource/index.html | 2 +- app/src/main/java/io/legado/app/constant/BookType.kt | 3 ++- app/src/main/java/io/legado/app/data/entities/BookSource.kt | 2 +- .../legado/app/ui/book/source/edit/BookSourceEditActivity.kt | 2 ++ app/src/main/res/values-es-rES/arrays.xml | 1 + app/src/main/res/values-pt-rBR/arrays.xml | 1 + app/src/main/res/values-zh-rHK/arrays.xml | 1 + app/src/main/res/values-zh-rTW/arrays.xml | 1 + app/src/main/res/values-zh/arrays.xml | 1 + app/src/main/res/values/arrays.xml | 1 + 10 files changed, 12 insertions(+), 3 deletions(-) diff --git a/app/src/main/assets/web/bookSource/index.html b/app/src/main/assets/web/bookSource/index.html index c3b6a4389..c67a810f7 100644 --- a/app/src/main/assets/web/bookSource/index.html +++ b/app/src/main/assets/web/bookSource/index.html @@ -25,7 +25,7 @@
源类型 :
+ placeholder="<必填>0:文本 1:音频 2:图片 3:文件(只提供下载的网站)">
源名称 :
diff --git a/app/src/main/java/io/legado/app/constant/BookType.kt b/app/src/main/java/io/legado/app/constant/BookType.kt index 848884275..13c21f4ae 100644 --- a/app/src/main/java/io/legado/app/constant/BookType.kt +++ b/app/src/main/java/io/legado/app/constant/BookType.kt @@ -5,7 +5,8 @@ import androidx.annotation.IntDef object BookType { const val default = 0 // 0 文本 const val audio = 1 // 1 音频 - const val image = 2 //图片 + const val image = 2 // 2 图片 + const val file = 3 // 3 只提供下载服务的网站 const val local = "loc_book" @Target(AnnotationTarget.VALUE_PARAMETER) diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt index 2d1d164c7..228ba7915 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt @@ -27,7 +27,7 @@ data class BookSource( var bookSourceName: String = "", // 分组 var bookSourceGroup: String? = null, - // 类型,0 文本,1 音频, 2 图片 + // 类型,0 文本,1 音频, 2 图片, 3 文件(指的是类似知轩藏书只提供下载的网站) @BookType.Type var bookSourceType: Int = 0, // 详情页url正则 diff --git a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt index 9b58c9a44..3f647fa46 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditActivity.kt @@ -192,6 +192,7 @@ class BookSourceEditActivity : binding.cbIsEnableFind.isChecked = it.enabledExplore binding.spType.setSelection( when (it.bookSourceType) { + BookType.file -> 3 BookType.image -> 2 BookType.audio -> 1 else -> 0 @@ -296,6 +297,7 @@ class BookSourceEditActivity : source.enabled = binding.cbIsEnable.isChecked source.enabledExplore = binding.cbIsEnableFind.isChecked source.bookSourceType = when (binding.spType.selectedItemPosition) { + 3 -> BookType.file 2 -> BookType.image 1 -> BookType.audio else -> BookType.default diff --git a/app/src/main/res/values-es-rES/arrays.xml b/app/src/main/res/values-es-rES/arrays.xml index 345f6964a..fe92af603 100644 --- a/app/src/main/res/values-es-rES/arrays.xml +++ b/app/src/main/res/values-es-rES/arrays.xml @@ -4,6 +4,7 @@ Texto Audio Image + File diff --git a/app/src/main/res/values-pt-rBR/arrays.xml b/app/src/main/res/values-pt-rBR/arrays.xml index aaa9e60d6..4739b9d08 100644 --- a/app/src/main/res/values-pt-rBR/arrays.xml +++ b/app/src/main/res/values-pt-rBR/arrays.xml @@ -4,6 +4,7 @@ Texto Áudio Image + File diff --git a/app/src/main/res/values-zh-rHK/arrays.xml b/app/src/main/res/values-zh-rHK/arrays.xml index ca4ebc0fc..0eaf1a340 100644 --- a/app/src/main/res/values-zh-rHK/arrays.xml +++ b/app/src/main/res/values-zh-rHK/arrays.xml @@ -5,6 +5,7 @@ 文本 音頻 图片 + 文件 diff --git a/app/src/main/res/values-zh-rTW/arrays.xml b/app/src/main/res/values-zh-rTW/arrays.xml index 019b34be3..3487a326a 100644 --- a/app/src/main/res/values-zh-rTW/arrays.xml +++ b/app/src/main/res/values-zh-rTW/arrays.xml @@ -4,6 +4,7 @@ 文字 音訊 图片 + 文件 diff --git a/app/src/main/res/values-zh/arrays.xml b/app/src/main/res/values-zh/arrays.xml index 970ae369c..d44eceafb 100644 --- a/app/src/main/res/values-zh/arrays.xml +++ b/app/src/main/res/values-zh/arrays.xml @@ -4,6 +4,7 @@ 文本 音频 图片 + 文件 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 8bc2d5232..47dd6b09a 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -4,6 +4,7 @@ Text Audio Image + File