排版页眉页脚跟随背景

pull/363/head
gedoor 4 years ago
parent eb09a59142
commit c0be0dba20
  1. 18
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  2. 36
      app/src/main/java/io/legado/app/help/ReadTipConfig.kt

@ -159,7 +159,7 @@ object ReadBookConfig {
var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar)
var hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar)
private val config get() = if (shareLayout) getConfig(5) else durConfig
val config get() = if (shareLayout) getConfig(5) else durConfig
var textFont: String
get() = config.textFont
@ -332,6 +332,14 @@ object ReadBookConfig {
exportConfig.footerPaddingTop = shearConfig.footerPaddingTop
exportConfig.showHeaderLine = shearConfig.showHeaderLine
exportConfig.showFooterLine = shearConfig.showFooterLine
exportConfig.tipHeaderLeft = shearConfig.tipHeaderLeft
exportConfig.tipHeaderMiddle = shearConfig.tipHeaderMiddle
exportConfig.tipHeaderRight = shearConfig.tipHeaderRight
exportConfig.tipFooterLeft = shearConfig.tipFooterLeft
exportConfig.tipFooterMiddle = shearConfig.tipFooterMiddle
exportConfig.tipFooterRight = shearConfig.tipFooterRight
exportConfig.hideHeader = shearConfig.hideHeader
exportConfig.hideFooter = shearConfig.hideFooter
}
return exportConfig
}
@ -375,6 +383,14 @@ object ReadBookConfig {
var footerPaddingTop: Int = 6,
var showHeaderLine: Boolean = false,
var showFooterLine: Boolean = true,
var tipHeaderLeft: Int = ReadTipConfig.time,
var tipHeaderMiddle: Int = ReadTipConfig.none,
var tipHeaderRight: Int = ReadTipConfig.battery,
var tipFooterLeft: Int = ReadTipConfig.chapterTitle,
var tipFooterMiddle: Int = ReadTipConfig.none,
var tipFooterRight: Int = ReadTipConfig.pageAndTotal,
var hideHeader: Boolean = true,
var hideFooter: Boolean = false
) : Parcelable {
fun setBg(bgType: Int, bg: String) {
when {

@ -2,10 +2,6 @@ package io.legado.app.help
import io.legado.app.App
import io.legado.app.R
import io.legado.app.utils.getPrefBoolean
import io.legado.app.utils.getPrefInt
import io.legado.app.utils.putPrefBoolean
import io.legado.app.utils.putPrefInt
object ReadTipConfig {
val tipArray: Array<String> = App.INSTANCE.resources.getStringArray(R.array.read_tip)
@ -25,50 +21,50 @@ object ReadTipConfig {
val tipFooterRightStr: String get() = tipArray.getOrElse(tipFooterRight) { tipArray[none] }
var tipHeaderLeft: Int
get() = App.INSTANCE.getPrefInt("tipHeaderLeft", time)
get() = ReadBookConfig.config.tipHeaderLeft
set(value) {
App.INSTANCE.putPrefInt("tipHeaderLeft", value)
ReadBookConfig.config.tipHeaderLeft = value
}
var tipHeaderMiddle: Int
get() = App.INSTANCE.getPrefInt("tipHeaderMiddle", none)
get() = ReadBookConfig.config.tipHeaderMiddle
set(value) {
App.INSTANCE.putPrefInt("tipHeaderMiddle", value)
ReadBookConfig.config.tipHeaderMiddle = value
}
var tipHeaderRight: Int
get() = App.INSTANCE.getPrefInt("tipHeaderRight", battery)
get() = ReadBookConfig.config.tipHeaderRight
set(value) {
App.INSTANCE.putPrefInt("tipHeaderRight", value)
ReadBookConfig.config.tipHeaderRight = value
}
var tipFooterLeft: Int
get() = App.INSTANCE.getPrefInt("tipFooterLeft", chapterTitle)
get() = ReadBookConfig.config.tipFooterLeft
set(value) {
App.INSTANCE.putPrefInt("tipFooterLeft", value)
ReadBookConfig.config.tipFooterLeft = value
}
var tipFooterMiddle: Int
get() = App.INSTANCE.getPrefInt("tipFooterMiddle", none)
get() = ReadBookConfig.config.tipFooterMiddle
set(value) {
App.INSTANCE.putPrefInt("tipFooterMiddle", value)
ReadBookConfig.config.tipFooterMiddle = value
}
var tipFooterRight: Int
get() = App.INSTANCE.getPrefInt("tipFooterRight", pageAndTotal)
get() = ReadBookConfig.config.tipFooterRight
set(value) {
App.INSTANCE.putPrefInt("tipFooterRight", value)
ReadBookConfig.config.tipFooterRight = value
}
var hideHeader: Boolean
get() = App.INSTANCE.getPrefBoolean("hideHeader", true)
get() = ReadBookConfig.config.hideHeader
set(value) {
App.INSTANCE.putPrefBoolean("hideHeader", value)
ReadBookConfig.config.hideHeader = value
}
var hideFooter: Boolean
get() = App.INSTANCE.getPrefBoolean("hideFooter", false)
get() = ReadBookConfig.config.hideFooter
set(value) {
App.INSTANCE.putPrefBoolean("hideFooter", value)
ReadBookConfig.config.hideFooter = value
}
}
Loading…
Cancel
Save