From e10af99b795d08d92ecaa86fe404d562bd6044b6 Mon Sep 17 00:00:00 2001 From: kunfei Date: Wed, 21 Aug 2019 11:40:46 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/help/ReadBookConfig.kt | 6 +++--- .../java/io/legado/app/ui/widget/page/ContentView.kt | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) 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?) {