mirror of
https://github.com/gedoor/legado.git
synced 2024-09-01 09:34:25 +08:00
优化
This commit is contained in:
parent
efcec85614
commit
7504bdb108
@ -91,7 +91,7 @@ object ChapterProvider {
|
||||
private var titleBottomSpacing = 0
|
||||
|
||||
@JvmStatic
|
||||
var typeface: Typeface = Typeface.DEFAULT
|
||||
var typeface: Typeface? = Typeface.DEFAULT
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
@ -637,7 +637,7 @@ object ChapterProvider {
|
||||
upLayout()
|
||||
}
|
||||
|
||||
private fun getTypeface(fontPath: String): Typeface {
|
||||
private fun getTypeface(fontPath: String): Typeface? {
|
||||
return kotlin.runCatching {
|
||||
when {
|
||||
fontPath.isContentScheme() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O -> {
|
||||
@ -666,7 +666,7 @@ object ChapterProvider {
|
||||
} ?: Typeface.DEFAULT
|
||||
}
|
||||
|
||||
private fun getPaints(typeface: Typeface): Pair<TextPaint, TextPaint> {
|
||||
private fun getPaints(typeface: Typeface?): Pair<TextPaint, TextPaint> {
|
||||
// 字体统一处理
|
||||
val bold = Typeface.create(typeface, Typeface.BOLD)
|
||||
val normal = Typeface.create(typeface, Typeface.NORMAL)
|
||||
|
Loading…
Reference in New Issue
Block a user