From 2505307288afa3ed27ced31cff79fbddd3a940eb Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 18 Apr 2020 16:21:39 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E5=B4=A9=E6=BA=83bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/ChapterProvider.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 d15ae0e61..ea0a1bd37 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 @@ -1,6 +1,7 @@ package io.legado.app.ui.book.read.page import android.graphics.Typeface +import android.os.Build import android.text.Layout import android.text.StaticLayout import android.text.TextPaint @@ -265,8 +266,11 @@ object ChapterProvider { titlePaint = TextPaint() titlePaint.color = ReadBookConfig.durConfig.textColor() titlePaint.letterSpacing = ReadBookConfig.letterSpacing - titlePaint.typeface = + titlePaint.typeface = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { Typeface.create(typeface, if (ReadBookConfig.textBold) 900 else 700, false) + } else { + Typeface.create(typeface, Typeface.BOLD) + } titlePaint.textSize = with(ReadBookConfig) { textSize + titleSize }.sp.toFloat() titlePaint.isAntiAlias = true //正文