From ce83e06135a5e448690ff90b42aa27a8abd27388 Mon Sep 17 00:00:00 2001 From: Aatricks Date: Mon, 6 Jul 2026 12:52:33 -0400 Subject: [PATCH] Fix(reader): toggle controls from the whole reader surface, not per-item Tap-to-toggle was a per-item clickable applied inside the text's horizontal margin padding, so the side margins, inter-paragraph gaps, empty space below short chapters, and gaps around image groups were dead zones where a tap did nothing. Felt like taps "not registering", worst when dismissing the menu. Add a single full-screen detectTapGestures on the content container. The LazyColumn/pager still win drags (the detector cancels on any consumed movement); per-item clickables still consume taps over text and images, so the container only fires in the former dead zones. Each tap toggles exactly once. --- .../ui/screens/reader/ReaderContentArea.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/main/java/io/aatricks/easyreader/ui/screens/reader/ReaderContentArea.kt b/app/src/main/java/io/aatricks/easyreader/ui/screens/reader/ReaderContentArea.kt index 9f63609c..c9172bf6 100644 --- a/app/src/main/java/io/aatricks/easyreader/ui/screens/reader/ReaderContentArea.kt +++ b/app/src/main/java/io/aatricks/easyreader/ui/screens/reader/ReaderContentArea.kt @@ -4,6 +4,7 @@ import androidx.compose.animation.AnimatedVisibility import androidx.compose.animation.slideInVertically import androidx.compose.animation.slideOutVertically import androidx.compose.foundation.background +import androidx.compose.foundation.gestures.detectTapGestures import androidx.compose.foundation.interaction.DragInteraction import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box @@ -33,6 +34,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.Alignment import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.input.nestedscroll.nestedScroll +import androidx.compose.ui.input.pointer.pointerInput import androidx.compose.ui.unit.dp import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver @@ -293,6 +295,16 @@ internal fun ContentArea( Box( modifier = Modifier .fillMaxSize() + // Single full-screen tap authority for toggling the reader controls. The + // per-item clickables only cover text glyphs, so horizontal margins, + // inter-paragraph gaps, and empty space below a short chapter were dead + // zones where a tap did nothing — felt like the tap "didn't register", + // worst when dismissing the menu (its bars shrink the reliable target). + // detectTapGestures cancels on any consumed movement, so the LazyColumn / + // pager still win drags; only clean taps that no child consumed reach here. + .pointerInput(Unit) { + detectTapGestures { readerViewModel.toggleControls() } + } .drawWithContent { if (uiState.showControls && edgeBlurCaptureGeneration != edgeBlurLastCaptured) { edgeBlurLayer.record(