From 8901926050eedb53858d273693c2340e5e02d354 Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 17 Dec 2021 20:38:38 +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 --- .../java/io/legado/app/ui/book/read/page/ContentTextView.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 6281569e5..9c33b0f67 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -139,17 +139,16 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at } else { ChapterProvider.contentPaint } - textPaint.color = - if (isReadAloud) context.accentColor else ReadBookConfig.textColor + val textColor = if (isReadAloud) context.accentColor else ReadBookConfig.textColor textChars.forEach { if (it.isImage) { drawImage(canvas, it, lineTop, lineBottom, isImageLine) } else { + textPaint.color = textColor if(it.isSearchResult) { textPaint.color = context.accentColor } canvas.drawText(it.charData, it.start, lineBase, textPaint) - textPaint.color = ReadBookConfig.textColor } if (it.selected) { canvas.drawRect(it.start, lineTop, it.end, lineBottom, selectedPaint)