From 1ccab90db4cddfafe0cf068197a4eeb875968e8c Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 23 Aug 2019 21:37:40 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/widget/page/ChapterProvider.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt index 2c6afd592..29a82318a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ChapterProvider.kt @@ -8,6 +8,8 @@ import io.legado.app.data.entities.BookChapter object ChapterProvider { + private val titleSpan = RelativeSizeSpan(1.3f) + @Synchronized fun getTextChapter(textView: ContentTextView, bookChapter: BookChapter, content: String): TextChapter { val textPages = arrayListOf() @@ -17,8 +19,12 @@ object ChapterProvider { while (surplusText.isNotEmpty()) { val spannableStringBuilder = SpannableStringBuilder(surplusText) if (pageIndex == 0) { - val span = RelativeSizeSpan(1.5f) - spannableStringBuilder.setSpan(span, 0, surplusText.indexOf("\n"), Spannable.SPAN_INCLUSIVE_EXCLUSIVE) + spannableStringBuilder.setSpan( + titleSpan, + 0, + surplusText.indexOf("\n"), + Spannable.SPAN_INCLUSIVE_EXCLUSIVE + ) } textView.text = spannableStringBuilder pageLengths.add(textView.getCharNum())