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" />
+
+