From 18a9e8d468cd00f6be569fa68d7b903c31be4952 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 12 Apr 2020 16:18:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/page/ChapterProvider.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index 0ac8f8caa..c5cd52b63 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -31,8 +31,8 @@ object ChapterProvider { private var titleTopSpacing = 0 private var titleBottomSpacing = 0 var typeface: Typeface = Typeface.SANS_SERIF - var titlePaint = TextPaint() - var contentPaint = TextPaint() + lateinit var titlePaint: TextPaint + lateinit var contentPaint: TextPaint init { upStyle() @@ -262,18 +262,20 @@ object ChapterProvider { Typeface.SANS_SERIF } //标题 - titlePaint.isAntiAlias = true + titlePaint = TextPaint() titlePaint.color = ReadBookConfig.durConfig.textColor() titlePaint.letterSpacing = ReadBookConfig.letterSpacing titlePaint.typeface = Typeface.create(typeface, Typeface.BOLD) titlePaint.textSize = with(ReadBookConfig) { textSize + titleSize }.sp.toFloat() + titlePaint.isAntiAlias = true //正文 - contentPaint.isAntiAlias = true + contentPaint = TextPaint() contentPaint.color = ReadBookConfig.durConfig.textColor() contentPaint.letterSpacing = ReadBookConfig.letterSpacing val style = if (ReadBookConfig.textBold) Typeface.BOLD else Typeface.NORMAL contentPaint.typeface = Typeface.create(typeface, style) contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() + contentPaint.isAntiAlias = true //间距 lineSpacingExtra = ReadBookConfig.lineSpacingExtra paragraphSpacing = ReadBookConfig.paragraphSpacing