增加纯黑暗色模式,清理代码

This commit is contained in:
HapeLee committed 2025-09-10 19:32:52 +08:00
1 parent 7e97a6be05
commit 011aaa0bb9
34 files changed
+848 -459

No files matched your search

@@ -5,6 +5,7 @@ import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.content.res.ColorStateList
import android.content.res.Configuration
import android.graphics.Color
import android.graphics.RenderEffect
import android.graphics.Shader
@@ -533,7 +534,13 @@ class BookInfoActivity :
val surfaceTransition = ValueAnimator.ofArgb(surfaceFinalColor, colorSurface).apply {
duration = 400L
addUpdateListener { animation ->
val color = animation.animatedValue as Int
val nightModeFlags =
resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
val isDarkMode = nightModeFlags == Configuration.UI_MODE_NIGHT_YES
var color = animation.animatedValue as Int
if (AppConfig.pureBlack && isDarkMode) {
color = Color.BLACK
}
binding.cdInfo?.setCardBackgroundColor(color)
binding.llInfo.setBackgroundColor(color)
(binding.llCover.background as? GradientDrawable)?.colors =