mirror of
https://github.com/gedoor/legado.git
synced 2024-07-06 23:47:49 +08:00
优化
This commit is contained in:
parent
1e35658d44
commit
c432d850a9
@ -2,11 +2,12 @@ package io.legado.app.ui.book.read.page
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
|
import androidx.core.content.ContextCompat
|
||||||
import androidx.core.view.isGone
|
import androidx.core.view.isGone
|
||||||
import androidx.core.view.isInvisible
|
import androidx.core.view.isInvisible
|
||||||
|
import io.legado.app.R
|
||||||
import io.legado.app.constant.AppConst.timeFormat
|
import io.legado.app.constant.AppConst.timeFormat
|
||||||
import io.legado.app.data.entities.Bookmark
|
import io.legado.app.data.entities.Bookmark
|
||||||
import io.legado.app.databinding.ViewBookPageBinding
|
import io.legado.app.databinding.ViewBookPageBinding
|
||||||
@ -70,13 +71,14 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
fun upStyle() = binding.run {
|
fun upStyle() = binding.run {
|
||||||
upTipStyle()
|
upTipStyle()
|
||||||
ReadBookConfig.let {
|
ReadBookConfig.let {
|
||||||
|
val textColor = it.textColor
|
||||||
val tipColor = with(ReadTipConfig) {
|
val tipColor = with(ReadTipConfig) {
|
||||||
if (tipColor == 0) it.textColor else tipColor
|
if (tipColor == 0) textColor else tipColor
|
||||||
}
|
}
|
||||||
val tipDividerColor = with(ReadTipConfig) {
|
val tipDividerColor = with(ReadTipConfig) {
|
||||||
when (tipDividerColor) {
|
when (tipDividerColor) {
|
||||||
-1 -> Color.parseColor("#66666666")
|
-1 -> ContextCompat.getColor(context, R.color.divider)
|
||||||
0 -> tipColor
|
0 -> textColor
|
||||||
else -> tipDividerColor
|
else -> tipDividerColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user