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) {