From d3f158e206e77e61fe3702a29e6a5ed3e7057b0b Mon Sep 17 00:00:00 2001 From: gedoor Date: Tue, 9 Mar 2021 14:11:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E7=9B=B8=E5=AF=B9=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E8=BD=AC=E7=BB=9D=E5=AF=B9=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../read/page/provider/ChapterProvider.kt | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 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 f1d2e3ffe..54fec4b6e 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 @@ -95,7 +95,8 @@ object ChapterProvider { val sb = StringBuffer() val matcher = AppPattern.imgPattern.matcher(text) while (matcher.find()) { - matcher.group(1)?.let { src -> + matcher.group(1)?.let { it -> + val src = NetworkUtils.getAbsoluteURL(bookChapter.url, it) srcList.add(src) ImageProvider.getImage(book, bookChapter.index, src) matcher.appendReplacement(sb, srcReplaceChar) @@ -117,16 +118,12 @@ object ChapterProvider { if (text.isNotBlank()) { val matcher = AppPattern.imgPattern.matcher(text) if (matcher.find()) { - matcher.group(1)?.let { mt -> + matcher.group(1)?.let { it -> if (!book.isEpub()) { - val src = NetworkUtils.getAbsoluteURL(bookChapter.url, mt) + val src = NetworkUtils.getAbsoluteURL(bookChapter.url, it) durY = setTypeImage( - book, - bookChapter, - src, - durY, - textPages, - book.getImageStyle() + book, bookChapter, src, + durY, textPages, book.getImageStyle() ) } } @@ -135,12 +132,8 @@ object ChapterProvider { val textPaint = if (isTitle) titlePaint else contentPaint if (!(isTitle && ReadBookConfig.titleMode == 2)) { durY = setTypeText( - text, - durY, - textPages, - stringBuilder, - isTitle, - textPaint + text, durY, textPages, + stringBuilder, isTitle, textPaint ) } }