From 5e7f27f56bbd1e3e0bd617abd7cfa4793366cb3d Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 21 Feb 2020 19:57:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/help/BookHelp.kt | 6 +++--- .../io/legado/app/ui/book/read/page/ContentTextView.kt | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index 1184e4143..e474bff96 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -257,9 +257,6 @@ object BookHelp { } } } - if (!content.substringBefore("\n").contains(title)) { - c = title + "\n" + c - } for (item in replaceRules) { item.pattern.let { if (it.isNotEmpty()) { @@ -271,6 +268,9 @@ object BookHelp { } } } + if (!content.substringBefore("\n").contains(title)) { + c = title + "\n" + c + } when (AppConfig.chineseConverterType) { 1 -> c = ZhConvertBootstrap.newInstance().toSimple(c) 2 -> c = ZhConvertBootstrap.newInstance().toTraditional(c) 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 a170ac02a..bf190deae 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 @@ -18,14 +18,17 @@ import io.legado.app.utils.getPrefBoolean class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, attrs) { - - var selectAble = context.getPrefBoolean(PreferKey.textSelectAble) private val selectedPaint by lazy { Paint().apply { color = context.getCompatColor(R.color.btn_bg_press_2) style = Paint.Style.FILL } } + var selectAble = context.getPrefBoolean(PreferKey.textSelectAble) + var selectStartLine = 0 + var selectStartChar = 0 + var selectEndLine = 0 + var selectEndChar = 0 private var textPage: TextPage? = null fun setContent(textPage: TextPage?) {