Fix TV controls nav after scrub; bump Play release to TV 0.14.49 and mobile 1.0.22.

This commit is contained in:
Jos Vooges | STH 2026-09-16 01:10:37 +02:00
parent d9785975e0
commit 93d96d7bb1
3 changed files with 49 additions and 24 deletions

View file

@ -20,8 +20,8 @@ android {
applicationId = "nl.vonas.mediacluster"
minSdk = 24
targetSdk = 36
versionCode = 22
versionName = "1.0.21"
versionCode = 23
versionName = "1.0.22"
buildConfigField("String", "DEFAULT_API_BASE", "\"https://master.vonas.nl\"")
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a")

View file

@ -20,8 +20,8 @@ android {
applicationId = "nl.vonas.mediacluster.tv"
minSdk = 24
targetSdk = 36
versionCode = 110
versionName = "0.14.47"
versionCode = 112
versionName = "0.14.49"
buildConfigField("String", "DEFAULT_API_BASE", "\"https://master.vonas.nl\"")
ndk {
abiFilters += listOf("arm64-v8a", "armeabi-v7a")

View file

@ -422,10 +422,14 @@ fun PlayerScreen(
}
LaunchedEffect(controls, menu, controlsNavMode) {
delay(40)
delay(60)
if (menu != null) return@LaunchedEffect
when {
controls && controlsNavMode -> runCatching { controlsFocus.requestFocus() }
controls && controlsNavMode -> {
// Even wachten tot knoppen gecomposeerd zijn.
delay(40)
runCatching { controlsFocus.requestFocus() }
}
else -> runCatching { catcherFocus.requestFocus() }
}
}
@ -475,13 +479,15 @@ fun PlayerScreen(
true
}
Key.DirectionLeft -> {
// Altijd scrubben (ook mét controls zichtbaar) — nooit door knoppen navigeren.
if (menu != null) return@onPreviewKeyEvent false
// In knoppenmodus: laat focus tussen knoppen bewegen.
if (controls && controlsNavMode) return@onPreviewKeyEvent false
scrubBy(-10_000)
true
}
Key.DirectionRight -> {
if (menu != null) return@onPreviewKeyEvent false
if (controls && controlsNavMode) return@onPreviewKeyEvent false
scrubBy(10_000)
true
}
@ -501,12 +507,20 @@ fun PlayerScreen(
}
Key.DirectionUp, Key.Menu -> {
if (menu != null) return@onPreviewKeyEvent false
if (controls && controlsNavMode) {
controlsNavMode = false
true
} else {
showControls(navMode = false)
true
when {
controls && controlsNavMode -> {
// Terug naar scrub-modus; ←/→ seeken weer.
controlsNavMode = false
true
}
controls -> {
hideControls()
true
}
else -> {
showControls(navMode = false)
true
}
}
}
else -> false
@ -683,13 +697,16 @@ fun PlayerScreen(
}
Row(
Modifier
.fillMaxWidth()
.focusRequester(controlsFocus),
Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(10.dp),
verticalAlignment = Alignment.CenterVertically,
) {
NetflixIconButton(if (playing) "❚❚" else "▶", primary = true) { togglePlay() }
NetflixIconButton(
label = if (playing) "❚❚" else "▶",
primary = true,
focusRequester = controlsFocus,
onClick = { togglePlay() },
)
NetflixIconButton("−10") {
scrubBy(-10_000)
}
@ -709,13 +726,15 @@ fun PlayerScreen(
showControls(navMode = true)
}
}
if (!controlsNavMode && scrubHint == null) {
Text(
"← → spoelen · ↓ knoppen · OK pauze",
color = Color(0x88FFFFFF),
fontSize = 12.sp,
)
}
Text(
if (controlsNavMode) {
"← → knoppen · ↑ terug naar spoelen · OK kiezen"
} else {
"← → spoelen · ↓ knoppen (audio/ondertitel) · OK pauze"
},
color = Color(0x88FFFFFF),
fontSize = 12.sp,
)
}
}
}
@ -877,10 +896,16 @@ private fun langLabel(code: String): String {
private fun NetflixIconButton(
label: String,
primary: Boolean = false,
focusRequester: FocusRequester? = null,
onClick: () -> Unit,
) {
Surface(
onClick = onClick,
modifier = if (focusRequester != null) {
Modifier.focusRequester(focusRequester)
} else {
Modifier
},
shape = ClickableSurfaceDefaults.shape(shape = CircleShape),
scale = ClickableSurfaceDefaults.scale(focusedScale = 1.12f),
border = ClickableSurfaceDefaults.border(