From 243da5dea627ea0262420aa791fa6c880f5fd2ee Mon Sep 17 00:00:00 2001
From: HapeLee <1321903405@qq.com>
Date: Tue, 11 Nov 2025 00:55:37 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E8=87=AA=E5=AE=9A=E4=B9=89?=
=?UTF-8?q?=E4=B8=8B=E5=88=92=E7=BA=BF=E4=B8=8E=E9=98=85=E8=AF=BB=E9=A1=B6?=
=?UTF-8?q?=E6=A0=8F=E7=9A=84=E5=89=8D=E6=8F=90=E5=B7=A5=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../legado/app/help/config/ReadBookConfig.kt | 38 +++++++++++++++++++
.../read/page/provider/ChapterProvider.kt | 2 +-
app/src/main/res/values-zh/arrays.xml | 12 ++++++
app/src/main/res/values/array_values.xml | 12 ++++++
app/src/main/res/values/arrays.xml | 12 ++++++
app/src/main/res/xml/pref_config_read.xml | 8 ++++
app/version.properties | 2 +-
7 files changed, 84 insertions(+), 2 deletions(-)
diff --git a/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt
index c22ac491f..83dcbe5c5 100644
--- a/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt
+++ b/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt
@@ -382,6 +382,12 @@ object ReadBookConfig {
config.underline = value
}
+ var underlineHeight: Int
+ get() = config.underlineHeight
+ set(value) {
+ config.underlineHeight = value
+ }
+
var dottedLine: Boolean
get() = config.dottedLine
set(value) {
@@ -622,6 +628,9 @@ object ReadBookConfig {
var titleSegFlag: String = "",//分段判断,碰到指定值时分段
var paragraphIndent: String = " ",//段落缩进
var underline: Boolean = false, //下划线
+ var underlineHeight: Int = 1,
+ var underlineColor: String = "#3E3D3B",
+ var underlineColorNight: String = "#ADADAD",
var dottedLine: Boolean = false, //虚线
var dottedBase: Float = 6f, //长度
var dottedRatio: Float = 6f,
@@ -678,6 +687,12 @@ object ReadBookConfig {
@Transient
private var menuAcColorNightInt = -1
+ @Transient
+ private var underlineColorInt = -1
+
+ @Transient
+ private var underlineColorNightInt = -1
+
@Transient
private var initColorInt = false
@@ -691,6 +706,8 @@ object ReadBookConfig {
menuBgColorNightInt = menuBgColorNight.toColorInt()
menuAcColorInt = menuAcColor.toColorInt()
menuAcColorNightInt = menuAcColorNight.toColorInt()
+ underlineColorInt = underlineColor.toColorInt()
+ underlineColorNightInt = underlineColorNight.toColorInt()
initColorInt = true
}
@@ -846,6 +863,27 @@ object ReadBookConfig {
}
}
+ fun curUnderlineColor(): Int {
+ return when {
+ AppConfig.isNightTheme -> underlineColorNightInt
+ else -> underlineColorInt
+ }
+ }
+
+ fun setUnderlineColor(bg: Int) {
+ when {
+ AppConfig.isNightTheme -> {
+ underlineColorNight = "#${bg.hexString}"
+ underlineColorNightInt = bg
+ }
+
+ else -> {
+ underlineColor = "#${bg.hexString}"
+ underlineColorInt = bg
+ }
+ }
+ }
+
fun curBgType(): Int {
return when {
AppConfig.isEInkMode -> bgTypeEInk
diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt
index c248ede13..c0c0553aa 100644
--- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt
+++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt
@@ -61,7 +61,7 @@ object ChapterProvider {
Paint(contentPaint).apply {
clearShadowLayer()
isAntiAlias = true
- strokeWidth = 1.dpToPx().toFloat()
+ strokeWidth = ReadBookConfig.underlineHeight.toFloat()
style = Paint.Style.STROKE
}
}
diff --git a/app/src/main/res/values-zh/arrays.xml b/app/src/main/res/values-zh/arrays.xml
index 7cc18d2d2..9f5a3f334 100644
--- a/app/src/main/res/values-zh/arrays.xml
+++ b/app/src/main/res/values-zh/arrays.xml
@@ -175,5 +175,17 @@
- 仅显示滑动条
+
+ - 自动
+ - 在应用栏上显示
+ - 在独立行上显示
+
+
+
+ - 不显示标题
+ - 不显示
+ - Disable title and chapter display
+
+
所有版本
\ No newline at end of file
diff --git a/app/src/main/res/values/array_values.xml b/app/src/main/res/values/array_values.xml
index e3cb729b6..6865c969b 100644
--- a/app/src/main/res/values/array_values.xml
+++ b/app/src/main/res/values/array_values.xml
@@ -98,4 +98,16 @@
- 4
+
+ - 0
+ - 1
+ - 2
+
+
+
+ - 0
+ - 1
+ - 2
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 902a7e5d2..8a3dc94ec 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -94,6 +94,18 @@
- Only slider
+
+ - Auto
+ - Show in TopBar
+ - Show in another line
+
+
+
+ - Disable title display
+ - Disable chapter display
+ - Disable title and chapter display
+
+
- @string/screen_unspecified
- @string/screen_portrait
diff --git a/app/src/main/res/xml/pref_config_read.xml b/app/src/main/res/xml/pref_config_read.xml
index ef041a909..0e2ce048b 100644
--- a/app/src/main/res/xml/pref_config_read.xml
+++ b/app/src/main/res/xml/pref_config_read.xml
@@ -41,6 +41,14 @@
android:title="@string/padding_display_cutouts"
app:isBottomBackground="true" />
+
+