From d4f7a08c965f22a9969943867bbbdd2d47ed56a9 Mon Sep 17 00:00:00 2001 From: Horis <8674809+821938089@users.noreply.github.com> Date: Sun, 2 Mar 2025 18:57:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 3 +-- .../io/legado/app/ui/book/manga/rv/WebtoonRecyclerView.kt | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3ca695b94..1dd7e1920 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -138,8 +138,7 @@ diff --git a/app/src/main/java/io/legado/app/ui/book/manga/rv/WebtoonRecyclerView.kt b/app/src/main/java/io/legado/app/ui/book/manga/rv/WebtoonRecyclerView.kt index 5d02298c7..8a9c7af86 100644 --- a/app/src/main/java/io/legado/app/ui/book/manga/rv/WebtoonRecyclerView.kt +++ b/app/src/main/java/io/legado/app/ui/book/manga/rv/WebtoonRecyclerView.kt @@ -60,6 +60,8 @@ class WebtoonRecyclerView @JvmOverloads constructor( halfHeight = MeasureSpec.getSize(heightSpec) / 2 if (!heightSet) { originalHeight = MeasureSpec.getSize(heightSpec) + val width = MeasureSpec.getSize(widthSpec) + setClickArea(width, originalHeight) heightSet = true } super.onMeasure(widthSpec, heightSpec) @@ -103,8 +105,7 @@ class WebtoonRecyclerView @JvmOverloads constructor( return super.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow, type) } - override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { - super.onSizeChanged(w, h, oldw, oldh) + private fun setClickArea(width: Int, height: Int) { mcRect.set(width * 0.33f, height * 0.33f, width * 0.66f, height * 0.66f) blRect.set(0f, height * 0.66f, width * 0.33f, height.toFloat()) brRect.set(width * 0.66f, height * 0.66f, width.toFloat(), height.toFloat())