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 2c1cbad80..e1913943b 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 @@ -6,20 +6,17 @@ import android.graphics.Paint import android.util.AttributeSet import android.view.View import io.legado.app.R +import io.legado.app.constant.PreferKey import io.legado.app.help.ReadBookConfig import io.legado.app.lib.theme.accentColor import io.legado.app.ui.book.read.page.entities.TextPage import io.legado.app.utils.getCompatColor +import io.legado.app.utils.getPrefBoolean -class ContentTextView : View { - constructor(context: Context) : super(context) - - constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) - - constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) - : super(context, attrs, defStyleAttr) +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) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index cbc4cb52a..0e5752c64 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -105,12 +105,8 @@ class ContentView : FrameLayout { } } - fun isTextSelected(): Boolean { - return false - } - - fun contentTextView(): ContentTextView? { - return content_text_view + fun upSelectAble(selectAble: Boolean) { + content_text_view.selectAble = selectAble } fun scrollTo(pos: Int?) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index 4ea4decdd..3295a0b58 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -153,6 +153,7 @@ class PageView(context: Context, attrs: AttributeSet) : fun upSelectAble(selectAble: Boolean) { pageDelegate?.upSelectAble(selectAble) + curPage.upSelectAble(selectAble) } fun upStyle() {