pull/32/head
kunfei 5 years ago
parent 5582df3669
commit e10af99b79
  1. 6
      app/src/main/java/io/legado/app/help/ReadBookConfig.kt
  2. 9
      app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt

@ -91,9 +91,9 @@ object ReadBookConfig {
var bgStr: String = "#015A86", var bgStr: String = "#015A86",
var bgType: Int = 0, var bgType: Int = 0,
var darkStatusIcon: Boolean = true, var darkStatusIcon: Boolean = true,
var letterSpacing: Int = 1, var letterSpacing: Float = 1f,
var lineSpacingExtra: Int = 15, var lineSpacingExtra: Float = 15f,
var lineSpacingMultiplier: Int = 3, var lineSpacingMultiplier: Float = 3f,
var paddingBottom: Int = 0, var paddingBottom: Int = 0,
var paddingLeft: Int = 16, var paddingLeft: Int = 16,
var paddingRight: Int = 16, var paddingRight: Int = 16,

@ -8,9 +8,9 @@ import android.widget.FrameLayout
import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatImageView
import io.legado.app.R import io.legado.app.R
import io.legado.app.help.ImageLoader import io.legado.app.help.ImageLoader
import io.legado.app.help.ReadBookConfig
import io.legado.app.utils.dp import io.legado.app.utils.dp
import kotlinx.android.synthetic.main.view_book_page.view.* import kotlinx.android.synthetic.main.view_book_page.view.*
import org.jetbrains.anko.horizontalPadding
import org.jetbrains.anko.matchParent import org.jetbrains.anko.matchParent
@ -31,7 +31,12 @@ class ContentView : FrameLayout {
} }
fun upStyle() { fun upStyle() {
page_panel.horizontalPadding = 16.dp ReadBookConfig.getConfig().apply {
page_panel.setPadding(paddingLeft.dp, paddingTop.dp, paddingRight.dp, paddingBottom.dp)
content_text_view.textSize = textSize.toFloat()
content_text_view.setLineSpacing(lineSpacingExtra, lineSpacingMultiplier)
content_text_view.letterSpacing = letterSpacing
}
} }
fun setBg(bg: Drawable?) { fun setBg(bg: Drawable?) {

Loading…
Cancel
Save