mirror of
https://github.com/gedoor/legado.git
synced 2024-08-30 09:23:26 +08:00
优化
This commit is contained in:
parent
4551281e6f
commit
5b9f6c7c2e
@ -89,6 +89,9 @@ object ReadBookConfig {
|
|||||||
configList.clear()
|
configList.clear()
|
||||||
configList.addAll(it)
|
configList.addAll(it)
|
||||||
}
|
}
|
||||||
|
for (i in configList.indices) {
|
||||||
|
configList[i].initColorInt()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun initShareConfig() {
|
fun initShareConfig() {
|
||||||
@ -537,9 +540,15 @@ object ReadBookConfig {
|
|||||||
var footerMode: Int = 0
|
var footerMode: Int = 0
|
||||||
) {
|
) {
|
||||||
|
|
||||||
private var textColorIntEInk = Color.parseColor(textColorEInk)
|
private var textColorIntEInk = -1
|
||||||
private var textColorIntNight = Color.parseColor(textColorNight)
|
private var textColorIntNight = -1
|
||||||
private var textColorInt = Color.parseColor(textColor)
|
private var textColorInt = -1
|
||||||
|
|
||||||
|
fun initColorInt() {
|
||||||
|
textColorIntEInk = Color.parseColor(textColorEInk)
|
||||||
|
textColorIntNight = Color.parseColor(textColorNight)
|
||||||
|
textColorInt = Color.parseColor(textColor)
|
||||||
|
}
|
||||||
|
|
||||||
fun setCurTextColor(color: Int) {
|
fun setCurTextColor(color: Int) {
|
||||||
when {
|
when {
|
||||||
@ -547,10 +556,12 @@ object ReadBookConfig {
|
|||||||
textColorEInk = "#${color.hexString}"
|
textColorEInk = "#${color.hexString}"
|
||||||
textColorIntEInk = color
|
textColorIntEInk = color
|
||||||
}
|
}
|
||||||
|
|
||||||
AppConfig.isNightTheme -> {
|
AppConfig.isNightTheme -> {
|
||||||
textColorNight = "#${color.hexString}"
|
textColorNight = "#${color.hexString}"
|
||||||
textColorIntNight = color
|
textColorIntNight = color
|
||||||
}
|
}
|
||||||
|
|
||||||
else -> {
|
else -> {
|
||||||
textColor = "#${color.hexString}"
|
textColor = "#${color.hexString}"
|
||||||
textColorInt = color
|
textColorInt = color
|
||||||
|
Loading…
Reference in New Issue
Block a user