From 7cd7b39ad8eb4b15ddc0aa81a837a1285f69ad6f Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 20 Sep 2019 21:03:50 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/ui/widget/page/ContentView.kt | 5 +++++ app/src/main/java/io/legado/app/ui/widget/page/PageView.kt | 1 + 2 files changed, 6 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 121280b9e..bf96fb382 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -5,6 +5,7 @@ import android.content.Context import android.graphics.Typeface import android.graphics.drawable.Drawable import android.util.AttributeSet +import android.view.MotionEvent import android.widget.FrameLayout import android.widget.ImageView import androidx.appcompat.widget.AppCompatImageView @@ -79,6 +80,10 @@ class ContentView : FrameLayout { } } + fun textViewTouch(event: MotionEvent) { + content_text_view.onTouchEvent(event) + } + fun setBg(bg: Drawable?) { //all supported ImageLoader.load(context, bg) diff --git a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt index 85d7be3d1..819b57ab3 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt @@ -114,6 +114,7 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att @SuppressLint("ClickableViewAccessibility") override fun onTouchEvent(event: MotionEvent): Boolean { + curPage?.textViewTouch(event) return pageDelegate?.onTouch(event) ?: super.onTouchEvent(event) }