pull/517/head
gedoor 4 years ago
parent cdad502e5e
commit 7e6c4cd935
  1. 52
      app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt

@ -58,16 +58,20 @@ class ContentView(context: Context) : FrameLayout(context) {
} }
fun upStyle() = with(binding) { fun upStyle() = with(binding) {
ReadBookConfig.apply { ChapterProvider.let {
bvHeaderLeft.typeface = ChapterProvider.typeface bvHeaderLeft.typeface = it.typeface
tvHeaderLeft.typeface = ChapterProvider.typeface tvHeaderLeft.typeface = it.typeface
tvHeaderMiddle.typeface = ChapterProvider.typeface tvHeaderMiddle.typeface = it.typeface
tvHeaderRight.typeface = ChapterProvider.typeface tvHeaderRight.typeface = it.typeface
bvFooterLeft.typeface = ChapterProvider.typeface bvFooterLeft.typeface = it.typeface
tvFooterLeft.typeface = ChapterProvider.typeface tvFooterLeft.typeface = it.typeface
tvFooterMiddle.typeface = ChapterProvider.typeface tvFooterMiddle.typeface = it.typeface
tvFooterRight.typeface = ChapterProvider.typeface tvFooterRight.typeface = it.typeface
val tipColor = if (ReadTipConfig.tipColor == 0) textColor else ReadTipConfig.tipColor }
ReadBookConfig.let {
val tipColor = with(ReadTipConfig) {
if (tipColor == 0) it.textColor else tipColor
}
bvHeaderLeft.setColor(tipColor) bvHeaderLeft.setColor(tipColor)
tvHeaderLeft.setColor(tipColor) tvHeaderLeft.setColor(tipColor)
tvHeaderMiddle.setColor(tipColor) tvHeaderMiddle.setColor(tipColor)
@ -78,26 +82,26 @@ class ContentView(context: Context) : FrameLayout(context) {
tvFooterRight.setColor(tipColor) tvFooterRight.setColor(tipColor)
upStatusBar() upStatusBar()
llHeader.setPadding( llHeader.setPadding(
headerPaddingLeft.dp, it.headerPaddingLeft.dp,
headerPaddingTop.dp, it.headerPaddingTop.dp,
headerPaddingRight.dp, it.headerPaddingRight.dp,
headerPaddingBottom.dp it.headerPaddingBottom.dp
) )
llFooter.setPadding( llFooter.setPadding(
footerPaddingLeft.dp, it.footerPaddingLeft.dp,
footerPaddingTop.dp, it.footerPaddingTop.dp,
footerPaddingRight.dp, it.footerPaddingRight.dp,
footerPaddingBottom.dp it.footerPaddingBottom.dp
) )
vwTopDivider.visible(showHeaderLine) vwTopDivider.visible(it.showHeaderLine)
vwBottomDivider.visible(showFooterLine) vwBottomDivider.visible(it.showFooterLine)
pageNvBar.layoutParams = pageNvBar.layoutParams.apply { pageNvBar.layoutParams = pageNvBar.layoutParams.apply {
height = if (hideNavigationBar) 0 else App.navigationBarHeight height = if (it.hideNavigationBar) 0 else App.navigationBarHeight
} }
contentTextView.upVisibleRect()
upTime()
upBattery(battery)
} }
contentTextView.upVisibleRect()
upTime()
upBattery(battery)
} }
/** /**

Loading…
Cancel
Save