From d766fc20bcc6e3fcc5ac2e3acce5c17527301538 Mon Sep 17 00:00:00 2001 From: kunfei Date: Tue, 27 Aug 2019 22:28:22 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/widget/page/ChapterProvider.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 7351379a6..68165caa5 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 @@ -24,10 +24,12 @@ object ChapterProvider { while (surplusText.isNotEmpty()) { val spannableStringBuilder = SpannableStringBuilder(surplusText) if (pageIndex == 0) { + var end = surplusText.indexOf("\n") + if (end == -1) end = surplusText.length.minus(1) spannableStringBuilder.setSpan( titleSpan, 0, - surplusText.indexOf("\n"), + end, Spannable.SPAN_INCLUSIVE_EXCLUSIVE ) }