mirror of
https://github.com/twinksoftware/Gearslip.git
synced 2026-11-10 16:02:25 +01:00
Faded map buttons press on the first tap instead of only waking up
This commit is contained in:
1 parent
6d32fe2bd3
commit
2d3de20682
1 file changed
+3
-12
@@ -248,8 +248,8 @@ internal fun RightEdgeControls(
|
|||||||
val hasPan = (actions + mapActions).any { it.type == Action.TYPE_PAN }
|
val hasPan = (actions + mapActions).any { it.type == Action.TYPE_PAN }
|
||||||
androidx.compose.runtime.LaunchedEffect(hasPan) { if (!hasPan) connection.setPanMode(false) }
|
androidx.compose.runtime.LaunchedEffect(hasPan) { if (!hasPan) connection.setPanMode(false) }
|
||||||
|
|
||||||
// Faded out when the screen has been left alone; then they are only a memory of buttons, so
|
// Faded out when the screen has been left alone, to leave the map clear, but still buttons:
|
||||||
// the first touch on one wakes them rather than pressing it.
|
// a tap on a faded one presses it straight away (and wakes the rest), as Android Auto's do.
|
||||||
val awake = LocalMapControlsWake.current.awake
|
val awake = LocalMapControlsWake.current.awake
|
||||||
val pan by connection.panMode.collectAsState()
|
val pan by connection.panMode.collectAsState()
|
||||||
// Kept up while the knob is on one of them, or the ring would fade out along with the button.
|
// Kept up while the knob is on one of them, or the ring would fade out along with the button.
|
||||||
@@ -280,16 +280,7 @@ internal fun RightEdgeControls(
|
|||||||
.alpha(alpha)
|
.alpha(alpha)
|
||||||
.focusRequester(knobFocus)
|
.focusRequester(knobFocus)
|
||||||
.focusGroup()
|
.focusGroup()
|
||||||
.onFocusChanged { holdsFocus = it.hasFocus }
|
.onFocusChanged { holdsFocus = it.hasFocus },
|
||||||
.let { base ->
|
|
||||||
if (visible) base else base.pointerInput(Unit) {
|
|
||||||
awaitPointerEventScope {
|
|
||||||
while (true) {
|
|
||||||
awaitPointerEvent(PointerEventPass.Initial).changes.forEach { it.consume() }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
horizontalAlignment = alignment,
|
horizontalAlignment = alignment,
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in new issue
Block a user