正文阴影

This commit is contained in:
HapeLee committed 2025-11-15 14:40:25 +08:00
1 parent 8cf43f2a75
commit 23f4347274
3 files changed
+16 -12

No files matched your search

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