正文阴影

This commit is contained in:
HapeLee
2025-11-15 14:40:25 +08:00
parent 8cf43f2a75
commit 23f4347274
3 changed files with 16 additions and 12 deletions
@@ -670,10 +670,10 @@ object ReadBookConfig {
private var textColorInt = -1
@Transient
private var textColorSIntNight = -1
private var shadowColorNightInt = -1
@Transient
private var textColorSInt = -1
private var shadowColorInt = -1
@Transient
private var menuBgColorInt = -1
@@ -700,8 +700,8 @@ object ReadBookConfig {
textColorIntEInk = textColorEInk.toColorInt()
textColorIntNight = textColorNight.toColorInt()
textColorInt = textColor.toColorInt()
textColorSIntNight = shadowColorN.toColorInt()
textColorSInt = shadowColor.toColorInt()
shadowColorNightInt = shadowColorN.toColorInt()
shadowColorInt = shadowColor.toColorInt()
menuBgColorInt = menuBgColor.toColorInt()
menuBgColorNightInt = menuBgColorNight.toColorInt()
menuAcColorInt = menuAcColor.toColorInt()
@@ -715,11 +715,11 @@ object ReadBookConfig {
when {
AppConfig.isNightTheme -> {
shadowColorN = "#${color.hexString}"
textColorSIntNight = color
shadowColorNightInt = color
}
else -> {
shadowColor = "#${color.hexString}"
textColorSInt = color
shadowColorInt = color
}
}
}
@@ -759,8 +759,8 @@ object ReadBookConfig {
initColorInt()
}
return when {
AppConfig.isNightTheme -> textColorSIntNight
else -> textColorSInt
AppConfig.isNightTheme -> shadowColorNightInt
else -> shadowColorInt
}
}
@@ -52,6 +52,7 @@ object ThemeConfig {
initNightMode()
BookCover.upDefaultCover()
postEvent(EventBus.RECREATE, "")
postEvent(EventBus.UP_CONFIG, arrayListOf(2))
}
fun applyDayNightInit(context: Context) {
@@ -1101,12 +1101,15 @@ object ChapterProvider {
visibleRight = viewWidth - paddingRight
visibleBottom = paddingTop + visibleHeight
val shadowPad = (contentPaint.shadowLayerRadius + 2).toInt()
visibleRect.set(
paddingLeft.toFloat(),
paddingTop.toFloat(),
visibleRight.toFloat(),
visibleBottom.toFloat()
(paddingLeft - shadowPad).toFloat(),
(paddingTop - shadowPad).toFloat(),
(visibleRight + shadowPad).toFloat(),
(visibleBottom + shadowPad).toFloat()
)
//TODO: 有关测量相关问题
}