From 37029c961c7ddb6945195c4a325c4ad7e1755bba Mon Sep 17 00:00:00 2001 From: lbwstco Date: Thu, 17 Jun 2021 16:31:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=85=A8=E9=9D=A2?= =?UTF-8?q?=E5=B1=8FHome=E6=89=8B=E5=8A=BF=E4=B8=8E=E5=B7=A6=E5=8F=B3?= =?UTF-8?q?=E7=BF=BB=E9=A1=B5=E5=86=B2=E7=AA=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/ui/book/read/page/ReadView.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt index 42886de3c..cb5bacf0d 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt @@ -6,9 +6,11 @@ import android.graphics.Canvas import android.graphics.Paint import android.graphics.Rect import android.graphics.RectF +import android.os.Build import android.util.AttributeSet import android.view.MotionEvent import android.view.ViewConfiguration +import android.view.WindowInsets import android.widget.FrameLayout import io.legado.app.help.AppConfig import io.legado.app.help.ReadBookConfig @@ -156,6 +158,16 @@ class ReadView(context: Context, attrs: AttributeSet) : @SuppressLint("ClickableViewAccessibility") override fun onTouchEvent(event: MotionEvent): Boolean { callBack.screenOffTimerStart() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + val insets = this.rootWindowInsets.getInsetsIgnoringVisibility(WindowInsets.Type.mandatorySystemGestures()) + val height = activity?.windowManager?.currentWindowMetrics?.bounds?.height() + if (height != null) { + if (event.y > height.minus(insets.bottom)) { + return true; + } + } + } + when (event.action) { MotionEvent.ACTION_DOWN -> { if (isTextSelected) {