Fix TV controls nav after scrub; bump Play release to TV 0.14.49 and mobile 1.0.22.
This commit is contained in:
parent
d9785975e0
commit
93d96d7bb1
3 changed files with 49 additions and 24 deletions
|
|
@ -20,8 +20,8 @@ android {
|
||||||
applicationId = "nl.vonas.mediacluster"
|
applicationId = "nl.vonas.mediacluster"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 22
|
versionCode = 23
|
||||||
versionName = "1.0.21"
|
versionName = "1.0.22"
|
||||||
buildConfigField("String", "DEFAULT_API_BASE", "\"https://master.vonas.nl\"")
|
buildConfigField("String", "DEFAULT_API_BASE", "\"https://master.vonas.nl\"")
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ android {
|
||||||
applicationId = "nl.vonas.mediacluster.tv"
|
applicationId = "nl.vonas.mediacluster.tv"
|
||||||
minSdk = 24
|
minSdk = 24
|
||||||
targetSdk = 36
|
targetSdk = 36
|
||||||
versionCode = 110
|
versionCode = 112
|
||||||
versionName = "0.14.47"
|
versionName = "0.14.49"
|
||||||
buildConfigField("String", "DEFAULT_API_BASE", "\"https://master.vonas.nl\"")
|
buildConfigField("String", "DEFAULT_API_BASE", "\"https://master.vonas.nl\"")
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
abiFilters += listOf("arm64-v8a", "armeabi-v7a")
|
||||||
|
|
|
||||||
|
|
@ -422,10 +422,14 @@ fun PlayerScreen(
|
||||||
}
|
}
|
||||||
|
|
||||||
LaunchedEffect(controls, menu, controlsNavMode) {
|
LaunchedEffect(controls, menu, controlsNavMode) {
|
||||||
delay(40)
|
delay(60)
|
||||||
if (menu != null) return@LaunchedEffect
|
if (menu != null) return@LaunchedEffect
|
||||||
when {
|
when {
|
||||||
controls && controlsNavMode -> runCatching { controlsFocus.requestFocus() }
|
controls && controlsNavMode -> {
|
||||||
|
// Even wachten tot knoppen gecomposeerd zijn.
|
||||||
|
delay(40)
|
||||||
|
runCatching { controlsFocus.requestFocus() }
|
||||||
|
}
|
||||||
else -> runCatching { catcherFocus.requestFocus() }
|
else -> runCatching { catcherFocus.requestFocus() }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -475,13 +479,15 @@ fun PlayerScreen(
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
Key.DirectionLeft -> {
|
Key.DirectionLeft -> {
|
||||||
// Altijd scrubben (ook mét controls zichtbaar) — nooit door knoppen navigeren.
|
|
||||||
if (menu != null) return@onPreviewKeyEvent false
|
if (menu != null) return@onPreviewKeyEvent false
|
||||||
|
// In knoppenmodus: laat focus tussen knoppen bewegen.
|
||||||
|
if (controls && controlsNavMode) return@onPreviewKeyEvent false
|
||||||
scrubBy(-10_000)
|
scrubBy(-10_000)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
Key.DirectionRight -> {
|
Key.DirectionRight -> {
|
||||||
if (menu != null) return@onPreviewKeyEvent false
|
if (menu != null) return@onPreviewKeyEvent false
|
||||||
|
if (controls && controlsNavMode) return@onPreviewKeyEvent false
|
||||||
scrubBy(10_000)
|
scrubBy(10_000)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
@ -501,14 +507,22 @@ fun PlayerScreen(
|
||||||
}
|
}
|
||||||
Key.DirectionUp, Key.Menu -> {
|
Key.DirectionUp, Key.Menu -> {
|
||||||
if (menu != null) return@onPreviewKeyEvent false
|
if (menu != null) return@onPreviewKeyEvent false
|
||||||
if (controls && controlsNavMode) {
|
when {
|
||||||
|
controls && controlsNavMode -> {
|
||||||
|
// Terug naar scrub-modus; ←/→ seeken weer.
|
||||||
controlsNavMode = false
|
controlsNavMode = false
|
||||||
true
|
true
|
||||||
} else {
|
}
|
||||||
|
controls -> {
|
||||||
|
hideControls()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> {
|
||||||
showControls(navMode = false)
|
showControls(navMode = false)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else -> false
|
else -> false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -683,13 +697,16 @@ fun PlayerScreen(
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
Modifier
|
Modifier.fillMaxWidth(),
|
||||||
.fillMaxWidth()
|
|
||||||
.focusRequester(controlsFocus),
|
|
||||||
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
) {
|
) {
|
||||||
NetflixIconButton(if (playing) "❚❚" else "▶", primary = true) { togglePlay() }
|
NetflixIconButton(
|
||||||
|
label = if (playing) "❚❚" else "▶",
|
||||||
|
primary = true,
|
||||||
|
focusRequester = controlsFocus,
|
||||||
|
onClick = { togglePlay() },
|
||||||
|
)
|
||||||
NetflixIconButton("−10") {
|
NetflixIconButton("−10") {
|
||||||
scrubBy(-10_000)
|
scrubBy(-10_000)
|
||||||
}
|
}
|
||||||
|
|
@ -709,16 +726,18 @@ fun PlayerScreen(
|
||||||
showControls(navMode = true)
|
showControls(navMode = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!controlsNavMode && scrubHint == null) {
|
|
||||||
Text(
|
Text(
|
||||||
"← → spoelen · ↓ knoppen · OK pauze",
|
if (controlsNavMode) {
|
||||||
|
"← → knoppen · ↑ terug naar spoelen · OK kiezen"
|
||||||
|
} else {
|
||||||
|
"← → spoelen · ↓ knoppen (audio/ondertitel) · OK pauze"
|
||||||
|
},
|
||||||
color = Color(0x88FFFFFF),
|
color = Color(0x88FFFFFF),
|
||||||
fontSize = 12.sp,
|
fontSize = 12.sp,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (showNextOverlay && nextEp != null) {
|
if (showNextOverlay && nextEp != null) {
|
||||||
val n = nextEp!!
|
val n = nextEp!!
|
||||||
|
|
@ -877,10 +896,16 @@ private fun langLabel(code: String): String {
|
||||||
private fun NetflixIconButton(
|
private fun NetflixIconButton(
|
||||||
label: String,
|
label: String,
|
||||||
primary: Boolean = false,
|
primary: Boolean = false,
|
||||||
|
focusRequester: FocusRequester? = null,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
Surface(
|
Surface(
|
||||||
onClick = onClick,
|
onClick = onClick,
|
||||||
|
modifier = if (focusRequester != null) {
|
||||||
|
Modifier.focusRequester(focusRequester)
|
||||||
|
} else {
|
||||||
|
Modifier
|
||||||
|
},
|
||||||
shape = ClickableSurfaceDefaults.shape(shape = CircleShape),
|
shape = ClickableSurfaceDefaults.shape(shape = CircleShape),
|
||||||
scale = ClickableSurfaceDefaults.scale(focusedScale = 1.12f),
|
scale = ClickableSurfaceDefaults.scale(focusedScale = 1.12f),
|
||||||
border = ClickableSurfaceDefaults.border(
|
border = ClickableSurfaceDefaults.border(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue