From f03ed16cbe70acdad755e45bbee8e6d4ecc89e12 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 23 Jan 2022 13:32:30 +0800 Subject: [PATCH 1/8] =?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/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index 39f6617da..f80163368 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -30,7 +30,6 @@ import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch import kotlinx.coroutines.withContext From f906380c8eab26cbdd5bc57462a0bc835dbfd426 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 23 Jan 2022 22:14:51 +0800 Subject: [PATCH 2/8] =?UTF-8?q?http=E6=9C=97=E8=AF=BB=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E8=BF=9E=E7=BB=AD=E9=94=99=E8=AF=AF5=E6=AC=A1=E5=90=8E?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/service/HttpReadAloudService.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt index b14f43d98..79f073b3b 100644 --- a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -180,22 +180,26 @@ class HttpReadAloudService : BaseReadAloudService(), is SocketTimeoutException, is ConnectException -> { removeSpeakCache(fileName) downloadErrorNo++ - if (playErrorNo > 5) { - downloadErrorNo = 0 - createSilentSound(fileName) + if (downloadErrorNo > 5) { val msg = "tts超时或连接错误超过5次\n${it.localizedMessage}" AppLog.put(msg, it) toastOnUi(msg) + pauseReadAloud(true) } else { downloadAudio() } } else -> { removeSpeakCache(fileName) - createSilentSound(fileName) + downloadErrorNo++ val msg = "tts下载错误\n${it.localizedMessage}" AppLog.put(msg, it) Timber.e(it) + if (downloadErrorNo > 5) { + pauseReadAloud(true) + } else { + createSilentSound(fileName) + } } } } From aba150b120a5863c01a76d851ddc272e83b37d7e Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 23 Jan 2022 22:30:23 +0800 Subject: [PATCH 3/8] =?UTF-8?q?http=E6=9C=97=E8=AF=BB=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E8=BF=9E=E7=BB=AD=E9=94=99=E8=AF=AF5=E6=AC=A1=E5=90=8E?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 1ed90388a..311cc540f 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,6 +11,11 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! +**2022/01/23** + +* 修复web写源订阅源保存失败bug +* http朗读下载错误连续5次后自动暂停 + **2022/01/20** * 添加payAction规则,返回购买链接 From 6461deecdd4eb4d78230c694af2e4a84c942f9d1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Jan 2022 10:30:33 +0800 Subject: [PATCH 4/8] =?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/src/main/assets/web/rssSource/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/assets/web/rssSource/index.js b/app/src/main/assets/web/rssSource/index.js index 95a80a588..0be9448a1 100644 --- a/app/src/main/assets/web/rssSource/index.js +++ b/app/src/main/assets/web/rssSource/index.js @@ -84,7 +84,7 @@ function rule2json() { RuleJSON.enabled = RuleJSON.enabled == '' || String(RuleJSON.enabled).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; RuleJSON.enableJs = RuleJSON.enableJs == '' || String(RuleJSON.enableJs).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; RuleJSON.loadWithBaseUrl = RuleJSON.loadWithBaseUrl == '' || String(RuleJSON.loadWithBaseUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; - RuleJSON.singleUrl = RuleJSON.singleUrl == '' || String(RuleJSON.singleUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; + RuleJSON.singleUrl = String(RuleJSON.singleUrl).toLocaleLowerCase().replace(/^\s*|\s*$/g, '') == 'true'; return RuleJSON; } // 将源对象填充到源表单 From 59511c9b1636c1ac171dc60749c00f86c8461f2e Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Jan 2022 20:10:03 +0800 Subject: [PATCH 5/8] =?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/src/main/res/layout/view_book_page.xml | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/layout/view_book_page.xml b/app/src/main/res/layout/view_book_page.xml index 95fd4f1f3..6e3b644f8 100644 --- a/app/src/main/res/layout/view_book_page.xml +++ b/app/src/main/res/layout/view_book_page.xml @@ -1,5 +1,6 @@ - + android:layout_height="wrap_content" + app:layout_constraintTop_toTopOf="parent"/> + android:gravity="center_vertical" + app:layout_constraintTop_toBottomOf="@id/vw_status_bar"> + android:visibility="invisible" + app:layout_constraintTop_toBottomOf="@id/ll_header"/> + android:layout_weight="1" + app:layout_constraintTop_toBottomOf="@id/vw_top_divider" + app:layout_constraintBottom_toTopOf="@id/vw_bottom_divider"/> + android:visibility="invisible" + app:layout_constraintBottom_toTopOf="@id/ll_footer"/> + android:gravity="center_vertical" + app:layout_constraintBottom_toBottomOf="parent"> - \ No newline at end of file + \ No newline at end of file From d102af7a8faf2e767d0e012de686918d24215d3d Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 26 Jan 2022 10:10:36 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 3f4b6c700..ef8b49bf5 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ buildscript { //maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } } dependencies { - classpath 'com.android.tools.build:gradle:7.0.4' + classpath 'com.android.tools.build:gradle:7.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'de.timfreiheit.resourceplaceholders:placeholders:0.4' classpath 'de.undercouch:gradle-download-task:4.1.2' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4a88e2259..637d848e9 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri May 07 15:24:46 CST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME From f917f77dde2b084fd82dd89e9d39669b161fa562 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 26 Jan 2022 19:22:24 +0800 Subject: [PATCH 7/8] =?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/src/main/assets/updateLog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 311cc540f..75f838848 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -11,10 +11,11 @@ * 正文出现缺字漏字、内容缺失、排版错乱等情况,有可能是净化规则或简繁转换出现问题。 * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! -**2022/01/23** +**2022/01/26** * 修复web写源订阅源保存失败bug * http朗读下载错误连续5次后自动暂停 +* 其它一些优化 **2022/01/20** From e3f75f60d307788b2af717446599bbed143d4115 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 27 Jan 2022 09:30:11 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E9=80=8F=E6=98=8E=E5=BA=A6=E8=B0=83=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/help/ReadBookConfig.kt | 9 +++++- .../io/legado/app/lib/theme/ThemeUtils.kt | 1 - .../app/ui/book/read/ReadBookActivity.kt | 1 + .../ui/book/read/config/BgTextConfigDialog.kt | 13 +++++++++ .../legado/app/ui/book/read/page/PageView.kt | 7 ++++- .../legado/app/ui/book/read/page/ReadView.kt | 8 +++++- .../main/res/layout/dialog_read_bg_text.xml | 28 +++++++++++++++---- app/src/main/res/layout/view_book_page.xml | 7 ++++- 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 | 3 ++ 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 | 3 +- 15 files changed, 74 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 0e0664565..bfd935ef0 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -163,6 +163,12 @@ object ReadBookConfig { val config get() = if (shareLayout) shareConfig else durConfig + var bgAlpha: Int + get() = config.bgAlpha + set(value) { + config.bgAlpha = value + } + var pageAnim: Int get() = config.curPageAnim() set(value) { @@ -419,7 +425,8 @@ object ReadBookConfig { var name: String = "", var bgStr: String = "#EEEEEE",//白天背景 var bgStrNight: String = "#000000",//夜间背景 - var bgStrEInk: String = "#FFFFFF", + var bgStrEInk: String = "#FFFFFF",//EInk背景 + var bgAlpha: Int = 100,//背景透明度 var bgType: Int = 0,//白天背景类型 0:颜色, 1:assets图片, 2其它图片 var bgTypeNight: Int = 0,//夜间背景类型 var bgTypeEInk: Int = 0, diff --git a/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt b/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt index 267c5cc67..198c3ad89 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ThemeUtils.kt @@ -33,7 +33,6 @@ object ThemeUtils { } } - @JvmOverloads fun resolveDrawable(context: Context, @AttrRes attr: Int): Drawable? { val a = context.theme.obtainStyledAttributes(intArrayOf(attr)) return try { diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 28ba6e57f..136aa71f5 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -1005,6 +1005,7 @@ class ReadBookActivity : BaseReadBookActivity(), upSystemUiVisibility() readView.upBg() readView.upStyle() + readView.upBgAlpha() if (it) { ReadBook.loadContent(resetPageOffset = false) } else { diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt index 438839367..fdc01bd8a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt @@ -9,6 +9,7 @@ import android.view.Gravity import android.view.View import android.view.ViewGroup import android.view.WindowManager +import android.widget.SeekBar import androidx.documentfile.provider.DocumentFile import com.jaredrummler.android.colorpicker.ColorPickerDialog import io.legado.app.R @@ -29,6 +30,7 @@ import io.legado.app.lib.theme.getPrimaryTextColor import io.legado.app.lib.theme.getSecondaryTextColor import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.document.HandleFileContract +import io.legado.app.ui.widget.seekbar.SeekBarChangeListener import io.legado.app.utils.* import io.legado.app.utils.viewbindingdelegate.viewBinding import timber.log.Timber @@ -108,6 +110,7 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) { ivImport.setColorFilter(primaryTextColor) ivExport.setColorFilter(primaryTextColor) ivDelete.setColorFilter(primaryTextColor) + tvBgAlpha.setTextColor(primaryTextColor) tvBgImage.setTextColor(primaryTextColor) recyclerView.adapter = adapter adapter.addHeaderView { @@ -130,6 +133,7 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) { private fun initData() = with(ReadBookConfig.durConfig) { binding.tvName.text = name.ifBlank { "文字" } binding.swDarkStatusIcon.isChecked = curStatusIconDark() + binding.sbBgAlpha.progress = bgAlpha } @SuppressLint("InflateParams") @@ -205,6 +209,15 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) { toastOnUi("数量已是最少,不能删除.") } } + binding.sbBgAlpha.setOnSeekBarChangeListener(object : SeekBarChangeListener { + override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { + ReadBookConfig.bgAlpha = progress + } + + override fun onStopTrackingTouch(seekBar: SeekBar) { + postEvent(EventBus.UP_CONFIG, false) + } + }) } @Suppress("BlockingMethodInNonBlockingContext") diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index f838c3166..8708e1175 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -185,7 +185,12 @@ class PageView(context: Context) : FrameLayout(context) { } fun setBg(bg: Drawable?) { - binding.pagePanel.background = bg + binding.vwBg.background = bg + upBgAlpha() + } + + fun upBgAlpha() { + binding.vwBg.alpha = ReadBookConfig.bgAlpha / 100f } fun upTime() { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt index 1cb59cb1a..baa394207 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt @@ -104,7 +104,7 @@ class ReadView(context: Context, attrs: AttributeSet) : } } - fun setRect9x() { + private fun setRect9x() { tlRect.set(0f, 0f, width * 0.33f, height * 0.33f) tcRect.set(width * 0.33f, 0f, width * 0.66f, height * 0.33f) trRect.set(width * 0.36f, 0f, width.toFloat(), height * 0.33f) @@ -534,6 +534,12 @@ class ReadView(context: Context, attrs: AttributeSet) : nextPage.setBg(ReadBookConfig.bg) } + fun upBgAlpha() { + curPage.upBgAlpha() + prevPage.upBgAlpha() + nextPage.upBgAlpha() + } + fun upTime() { curPage.upTime() prevPage.upTime() diff --git a/app/src/main/res/layout/dialog_read_bg_text.xml b/app/src/main/res/layout/dialog_read_bg_text.xml index 73faa0c78..e2c2a2ee2 100644 --- a/app/src/main/res/layout/dialog_read_bg_text.xml +++ b/app/src/main/res/layout/dialog_read_bg_text.xml @@ -12,8 +12,8 @@ + android:gravity="center_vertical" + android:padding="6dp"> + app:tint="@color/secondaryText" /> + android:text="@string/dark_status_icon" + tools:ignore="TouchTargetSizeCheck" /> + + + + + + 展开文本选择菜单 书籍保存位置 从其它应用打开的书籍保存位置 + 背景透明度 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index ed121ea77..42a11b401 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -916,5 +916,6 @@ 展开文本选择菜单 书籍保存位置 从其它应用打开的书籍保存位置 + 背景透明度 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 60ec51145..79f653394 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -418,6 +418,7 @@ 目录列表规则(capítuloLista) 章节名称规则(capítuloNome) 章节URL规则(capítuloUrl) + 卷标识(isVolume) VIP标识(éVip) 更新时间(capítuloInfo) 正文规则(conteúdo) @@ -426,6 +427,7 @@ 资源正则(fonteRegex) 替换规则(substRegex) 图片样式(imagemFormato) + 购买操作(payAction) 图标(fonteÍcone) 列表规则(regrasArtigos) @@ -914,5 +916,6 @@ 展开文本选择菜单 书籍保存位置 从其它应用打开的书籍保存位置 + 背景透明度 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 4ea4750da..b3759c663 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -913,5 +913,6 @@ 展开文本选择菜单 书籍保存位置 从其它应用打开的书籍保存位置 + 背景透明度 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 2c163ac5d..5f4e69d82 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -915,5 +915,6 @@ 搜尋結果 書籍儲存位置 從其它應用程式打開的書籍儲存位置 + 背景透明度 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index bd023a0a0..5df8c8f4a 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -915,5 +915,6 @@ 展开文本选择菜单 书籍保存位置 从其它应用打开的书籍保存位置 + 背景透明度 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d88a10077..624fdf9ad 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -418,7 +418,7 @@ 目录列表规则(chapterList) 章节名称规则(ChapterName) 章节URL规则(chapterUrl) - Volume标识(isVolume) + 卷标识(isVolume) VIP标识(isVip) 更新时间(ChapterInfo) 正文规则(content) @@ -916,5 +916,6 @@ 展开文本选择菜单 书籍保存位置 从其它应用打开的书籍保存位置 + 背景透明度