diff --git a/app/src/main/java/io/legado/app/help/config/ReadTipConfig.kt b/app/src/main/java/io/legado/app/help/config/ReadTipConfig.kt
index f67becf35..dc36ffae0 100644
--- a/app/src/main/java/io/legado/app/help/config/ReadTipConfig.kt
+++ b/app/src/main/java/io/legado/app/help/config/ReadTipConfig.kt
@@ -26,6 +26,10 @@ object ReadTipConfig {
)
val tipNames get() = appCtx.resources.getStringArray(R.array.read_tip).toList()
+ val tipColorNames get() = appCtx.resources.getStringArray(R.array.tip_color).toList()
+ val tipDividerColorNames
+ get() = appCtx.resources.getStringArray(R.array.tip_divider_color).toList()
+
var tipHeaderLeft: Int
get() = ReadBookConfig.config.tipHeaderLeft
set(value) {
diff --git a/app/src/main/java/io/legado/app/lib/theme/view/ThemeRadioNoButton.kt b/app/src/main/java/io/legado/app/lib/theme/view/ThemeRadioNoButton.kt
index cc23da707..3bba9f179 100644
--- a/app/src/main/java/io/legado/app/lib/theme/view/ThemeRadioNoButton.kt
+++ b/app/src/main/java/io/legado/app/lib/theme/view/ThemeRadioNoButton.kt
@@ -4,6 +4,7 @@ import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatRadioButton
+import androidx.appcompat.widget.TooltipCompat
import io.legado.app.R
import io.legado.app.lib.theme.Selector
import io.legado.app.lib.theme.accentColor
@@ -24,6 +25,7 @@ class ThemeRadioNoButton(context: Context, attrs: AttributeSet) :
typedArray.getBoolean(R.styleable.ThemeRadioNoButton_isBottomBackground, false)
typedArray.recycle()
initTheme()
+ TooltipCompat.setTooltipText(this, text)
}
private fun initTheme() {
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 ad5099c17..11435386f 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
@@ -11,6 +11,7 @@ import android.view.View
import android.view.ViewGroup
import android.view.WindowManager
import android.widget.SeekBar
+import androidx.appcompat.widget.TooltipCompat
import androidx.documentfile.provider.DocumentFile
import com.jaredrummler.android.colorpicker.ColorPickerDialog
import io.legado.app.R
@@ -220,6 +221,9 @@ class BgTextConfigDialog : BaseDialogFragment(R.layout.dialog_read_bg_text) {
.setDialogId(BG_COLOR)
.show(requireActivity())
}
+ binding.tvBgColor.apply {
+ TooltipCompat.setTooltipText(this, text)
+ }
binding.ivImport.setOnClickListener {
selectImportDoc.launch {
mode = HandleFileContract.FILE
diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt
index dafd069f6..de0d4ca56 100644
--- a/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt
+++ b/app/src/main/java/io/legado/app/ui/book/read/config/TextFontWeightConverter.kt
@@ -15,7 +15,7 @@ import io.legado.app.ui.widget.text.StrokeTextView
class TextFontWeightConverter(context: Context, attrs: AttributeSet?) :
StrokeTextView(context, attrs) {
- private val spannableString = SpannableString("中/粗/细")
+ private val spannableString = SpannableString(context.getString(R.string.font_weight_text))
private var enabledSpan: ForegroundColorSpan = ForegroundColorSpan(context.accentColor)
private var onChanged: (() -> Unit)? = null
diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt
index d78a2d9f0..fc55292c2 100644
--- a/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt
+++ b/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt
@@ -75,19 +75,21 @@ class TipConfigDialog : BaseDialogFragment(R.layout.dialog_tip_config) {
}
private fun upTvTipColor() {
- binding.tvTipColor.text =
- if (ReadTipConfig.tipColor == 0) {
- "跟随正文"
- } else {
- "#${ReadTipConfig.tipColor.hexString}"
- }
+ val tipColorNames = ReadTipConfig.tipColorNames
+ val tipColor = ReadTipConfig.tipColor
+ binding.tvTipColor.text = if (tipColor == 0) {
+ tipColorNames.first()
+ } else {
+ "#${tipColor.hexString}"
+ }
}
private fun upTvTipDividerColor() {
- binding.tvTipDividerColor.text = when (ReadTipConfig.tipDividerColor) {
- -1 -> "默认"
- 0 -> "跟随文字颜色"
- else -> "#${ReadTipConfig.tipDividerColor.hexString}"
+ val tipDividerColorNames = ReadTipConfig.tipDividerColorNames
+ val tipDividerColor = ReadTipConfig.tipDividerColor
+ binding.tvTipDividerColor.text = when (tipDividerColor) {
+ -1, 0 -> tipDividerColorNames[tipDividerColor + 1]
+ else -> "#${tipDividerColor.hexString}"
}
}
@@ -179,13 +181,14 @@ class TipConfigDialog : BaseDialogFragment(R.layout.dialog_tip_config) {
}
}
llTipColor.setOnClickListener {
- context?.selector(items = arrayListOf("跟随正文", "自定义")) { _, i ->
+ context?.selector(items = ReadTipConfig.tipColorNames) { _, i ->
when (i) {
0 -> {
ReadTipConfig.tipColor = 0
upTvTipColor()
postEvent(EventBus.UP_CONFIG, arrayOf(2))
}
+
1 -> ColorPickerDialog.newBuilder()
.setShowAlphaSlider(false)
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
@@ -195,13 +198,14 @@ class TipConfigDialog : BaseDialogFragment(R.layout.dialog_tip_config) {
}
}
llTipDividerColor.setOnClickListener {
- context?.selector(items = arrayListOf("默认", "跟随文字颜色", "自定义")) { _, i ->
+ context?.selector(items = ReadTipConfig.tipDividerColorNames) { _, i ->
when (i) {
0, 1 -> {
ReadTipConfig.tipDividerColor = i - 1
upTvTipDividerColor()
postEvent(EventBus.UP_CONFIG, arrayOf(2))
}
+
2 -> ColorPickerDialog.newBuilder()
.setShowAlphaSlider(false)
.setDialogType(ColorPickerDialog.TYPE_CUSTOM)
diff --git a/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt b/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt
index 5004f1cd0..8b0790ab3 100644
--- a/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt
+++ b/app/src/main/java/io/legado/app/ui/widget/DetailSeekBar.kt
@@ -6,6 +6,7 @@ import android.util.AttributeSet
import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.SeekBar
+import androidx.appcompat.widget.TooltipCompat
import io.legado.app.R
import io.legado.app.databinding.ViewDetailSeekBarBinding
import io.legado.app.lib.theme.bottomBackground
@@ -42,7 +43,11 @@ class DetailSeekBar @JvmOverloads constructor(
val typedArray = context.obtainStyledAttributes(attrs, R.styleable.DetailSeekBar)
isBottomBackground =
typedArray.getBoolean(R.styleable.DetailSeekBar_isBottomBackground, false)
- binding.tvSeekTitle.text = typedArray.getText(R.styleable.DetailSeekBar_title)
+ val title = typedArray.getText(R.styleable.DetailSeekBar_title)
+ binding.tvSeekTitle.apply {
+ text = title
+ TooltipCompat.setTooltipText(this, title)
+ }
binding.seekBar.max = typedArray.getInteger(R.styleable.DetailSeekBar_max, 0)
typedArray.recycle()
if (isBottomBackground && !isInEditMode) {
diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml
index 8e786f0f1..38f0439c8 100644
--- a/app/src/main/res/values-es-rES/strings.xml
+++ b/app/src/main/res/values-es-rES/strings.xml
@@ -1144,4 +1144,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml
index 2dddeca34..fdb868757 100644
--- a/app/src/main/res/values-ja-rJP/strings.xml
+++ b/app/src/main/res/values-ja-rJP/strings.xml
@@ -1147,4 +1147,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml
index 6b0835166..d70723d51 100644
--- a/app/src/main/res/values-pt-rBR/strings.xml
+++ b/app/src/main/res/values-pt-rBR/strings.xml
@@ -1147,4 +1147,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml
index 8a3773de4..ad7c79358 100644
--- a/app/src/main/res/values-vi/strings.xml
+++ b/app/src/main/res/values-vi/strings.xml
@@ -1143,4 +1143,5 @@ Còn
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index c0f5d9aac..145ee83f2 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -1144,4 +1144,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 2b2283475..055ab63de 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -1146,4 +1146,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values-zh/arrays.xml b/app/src/main/res/values-zh/arrays.xml
index c8d8d4f3c..8adc1c883 100644
--- a/app/src/main/res/values-zh/arrays.xml
+++ b/app/src/main/res/values-zh/arrays.xml
@@ -103,4 +103,15 @@
- 替换规则
+
+ - 跟随内容
+ - 自定义
+
+
+
+ - 默认
+ - 跟随内容
+ - 自定义
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml
index 46e92a07a..853cbc332 100644
--- a/app/src/main/res/values-zh/strings.xml
+++ b/app/src/main/res/values-zh/strings.xml
@@ -1146,4 +1146,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ 中/粗/细
diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml
index 1faccd1a4..2d3e5a0f1 100644
--- a/app/src/main/res/values/arrays.xml
+++ b/app/src/main/res/values/arrays.xml
@@ -158,4 +158,15 @@
- my
+
+ - Same color as content
+ - Customize
+
+
+
+ - Default
+ - Same color as content
+ - Customize
+
+
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ab111d668..90e46907a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -288,10 +288,10 @@
Bottom
Top
Padding
- Padding top
- Padding bottom
- Padding left
- Padding right
+ Top
+ Bottom
+ Left
+ Right
Check book sources
Check the selected source
%1$s Progress %2$d/%3$d
@@ -808,7 +808,7 @@
None
Title
Show/Hide
- footer header
+ Footer Header
Rule Subscription
Add the rule import address provided by the bosses\nClick to import rules after adding
Pull the cloud progress
@@ -854,7 +854,7 @@
List source code
Font size
Margin top
- Marigin bottom
+ Margin bottom
Show
Hide
Hide when status bar show
@@ -1064,7 +1064,7 @@
Replace (enable / disable)
Show last updated time
Refresh list
- Separator color
+ Divider color
Remove duplicate title
Update failed
Reading requires sending notifications to show reading control and download progress
@@ -1147,4 +1147,5 @@
创建堆转储
当应用发生OOM崩溃时保存堆转储
记录堆转储
+ N/B/L