From ed763ecb9b1c3f1c7183acb1c6594eb1c429b84c Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 4 Dec 2026 09:22:27 -0500 Subject: [PATCH] Let the session drawer expand to the screen's left edge (#3691) Keep the resize grip usable at full width and reserve its touch area from Android Back gestures. --- .../main/java/com/droiddeck/launcher/ui/SessionOverlay.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt index 2430aa45f9..26524d326e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SessionOverlay.kt @@ -84,6 +84,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width +import androidx.compose.foundation.systemGestureExclusion import androidx.compose.foundation.ScrollState import androidx.compose.foundation.horizontalScroll import androidx.compose.foundation.rememberScrollState @@ -548,8 +549,8 @@ internal fun SessionDrawer(open: Boolean, requestedPage: SessionDrawerPage, cont } androidx.compose.foundation.layout.BoxWithConstraints(modifier = Modifier.fillMaxSize().exposeTestTags(), contentAlignment = Alignment.CenterEnd) { val short = maxHeight < 440.dp - // The handle keeps a strip on the left free, so a sheet dragged wide can always be dragged back. - val maxSheet = (maxWidth - DRAWER_EDGE_GAP).coerceAtLeast(0.dp) + // At full width the handle's strip sits on the screen's left edge, so the sheet can still be dragged back. + val maxSheet = (maxWidth - DRAWER_HANDLE_STRIP).coerceAtLeast(0.dp) val minSheet = minOf(DRAWER_MIN_WIDTH, maxSheet) val defaultSheet = minOf(420.dp, maxWidth * 0.92f) val sheetWidth = if (docked) maxWidth else (savedWidth?.dp ?: defaultSheet).coerceIn(minSheet, maxSheet) @@ -1556,7 +1557,6 @@ internal fun secondScreenModes(none: Boolean, deckPad: Boolean, dashboard: Boole private val DRAWER_MIN_WIDTH = 300.dp private val DRAWER_HANDLE_STRIP = 24.dp -private val DRAWER_EDGE_GAP = 80.dp /** A grip on the sheet's left edge: dragging it, or pressing left and right on a controller, resizes the sheet. */ @Composable @@ -1578,6 +1578,8 @@ private fun DrawerResizeHandle(width: Dp, min: Dp, max: Dp, onWidth: (Dp) -> Uni contentAlignment = Alignment.Center, modifier = modifier.width(24.dp).height(96.dp) .onGloballyPositioned { coords = it } + // On the screen's edge, Android's back swipe would take the drag. + .systemGestureExclusion() .focusable(true, source) .onPreviewKeyEvent { event -> val key = event.nativeKeyEvent