diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index 5352a049d..c54c0b6a7 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -91,9 +91,9 @@ object ReadBookConfig { var bgStr: String = "#015A86", var bgType: Int = 0, var darkStatusIcon: Boolean = true, - var letterSpacing: Int = 1, - var lineSpacingExtra: Int = 15, - var lineSpacingMultiplier: Int = 3, + var letterSpacing: Float = 1f, + var lineSpacingExtra: Float = 15f, + var lineSpacingMultiplier: Float = 3f, var paddingBottom: Int = 0, var paddingLeft: Int = 16, var paddingRight: Int = 16, diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 43125c38e..38833feaf 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -8,9 +8,9 @@ import android.widget.FrameLayout import androidx.appcompat.widget.AppCompatImageView import io.legado.app.R import io.legado.app.help.ImageLoader +import io.legado.app.help.ReadBookConfig import io.legado.app.utils.dp import kotlinx.android.synthetic.main.view_book_page.view.* -import org.jetbrains.anko.horizontalPadding import org.jetbrains.anko.matchParent @@ -31,7 +31,12 @@ class ContentView : FrameLayout { } 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?) {