Minibar swipe-up-to-restore + vc=74 (0.1.0-CH)
Item 1 (partial): the minibar was tap-to-expand only — added an upward-drag gesture that expands back to the full player when released past a small threshold (Cobb: couldn't swipe the minibar back up). The continuous collapse-into-the-bar shared-element animation is deferred — needs on-device iteration. vc=74 ships items 2-5 fully + this.
This commit is contained in:
parent
22f4682608
commit
e2723adc71
2 changed files with 26 additions and 3 deletions
|
|
@ -57,6 +57,6 @@ const val STRAW_SDK_TARGET = 35
|
|||
// vc=19 / 0.1.0-AE — rust pipeline cutover. Extraction via
|
||||
// strawcore-core (Sulkta-Coop/strawcore) via the UniFFI wrapper; no
|
||||
// NewPipeExtractor in the runtime path.
|
||||
const val STRAW_VERSION_CODE = 73
|
||||
const val STRAW_VERSION_NAME = "0.1.0-CG"
|
||||
const val STRAW_VERSION_CODE = 74
|
||||
const val STRAW_VERSION_NAME = "0.1.0-CH"
|
||||
const val STRAW_APPLICATION_ID = "com.sulkta.straw"
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ package com.sulkta.straw.feature.player
|
|||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.gestures.Orientation
|
||||
import androidx.compose.foundation.gestures.draggable
|
||||
import androidx.compose.foundation.gestures.rememberDraggableState
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
|
@ -40,6 +43,7 @@ import androidx.compose.material3.Text
|
|||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableFloatStateOf
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
|
|
@ -101,6 +105,16 @@ fun MinibarOverlay(
|
|||
onDispose { controller.removeListener(listener) }
|
||||
}
|
||||
|
||||
// Swipe up on the bar to expand back to the full player (vc=74). Was
|
||||
// tap-only before — Cobb couldn't swipe the minibar back up to return
|
||||
// to the video. Tap still works; this just adds the upward-drag path.
|
||||
// Accumulates the vertical drag and expands when released past a small
|
||||
// upward threshold (delta is negative going up).
|
||||
val density = androidx.compose.ui.platform.LocalDensity.current
|
||||
val expandThresholdPx = with(density) { 32.dp.toPx() }
|
||||
var dragUp by remember { mutableFloatStateOf(0f) }
|
||||
val expandDragState = rememberDraggableState { delta -> dragUp += delta }
|
||||
|
||||
// navigationBarsPadding shifts the whole minibar up by the system
|
||||
// nav-bar height so the bar sits ABOVE the gesture pill / 3-button
|
||||
// nav, not behind them. enableEdgeToEdge in StrawActivity means
|
||||
|
|
@ -112,7 +126,16 @@ fun MinibarOverlay(
|
|||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.height(64.dp)
|
||||
.clickable(onClick = onExpand),
|
||||
.clickable(onClick = onExpand)
|
||||
.draggable(
|
||||
orientation = Orientation.Vertical,
|
||||
state = expandDragState,
|
||||
onDragStarted = { dragUp = 0f },
|
||||
onDragStopped = {
|
||||
if (dragUp < -expandThresholdPx) onExpand()
|
||||
dragUp = 0f
|
||||
},
|
||||
),
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue