From 15f198ba1cfde8b784cbbce6832319e8611ee39a Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 11 Sep 2022 17:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../read/page/provider/ChapterProvider.kt | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index fad724fc1..86796aa9f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -498,34 +498,32 @@ object ChapterProvider { isLineEnd: Boolean, srcList: LinkedList? ) { - if (srcList != null && char == srcReplaceChar) { - val src = srcList.removeFirst() - ImageProvider.cacheImage(book, src, ReadBook.bookSource) - textLine.addColumn( + val column = when { + srcList != null && char == srcReplaceChar -> { + val src = srcList.removeFirst() + ImageProvider.cacheImage(book, src, ReadBook.bookSource) TextColumn( start = absStartX + xStart, end = absStartX + xEnd, charData = src ) - ) - } else { - val column = if (isLineEnd && char == reviewChar) { + } + isLineEnd && char == reviewChar -> { ReviewColumn( start = absStartX + xStart, end = absStartX + xEnd, - count = 1 + count = 2 ) - } else { + } + else -> { TextColumn( start = absStartX + xStart, end = absStartX + xEnd, charData = char ) } - textLine.addColumn( - column - ) } + textLine.addColumn(column) } /**