mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
feat: Implement custom keyboard for Android TV (#523)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
721fc28060
commit
75c2f958b4
22 changed files with 927 additions and 157 deletions
|
|
@ -33,6 +33,7 @@ fun AudioPicker(
|
|||
val listState = rememberLazyListState()
|
||||
|
||||
LaunchedEffect(selectedIndex) {
|
||||
if (selectedIndex == -1) return@LaunchedEffect
|
||||
listState.scrollToItem(
|
||||
audioTracks.indexOfFirst { it.index == selectedIndex.toLong() }
|
||||
)
|
||||
|
|
@ -50,15 +51,16 @@ fun AudioPicker(
|
|||
verticalArrangement = Arrangement.spacedBy(6.dp)
|
||||
) {
|
||||
item {
|
||||
val selectedOff = -1 == selectedIndex
|
||||
TrackButton(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.defaultSelected(-1 == selectedIndex),
|
||||
.defaultSelected(selectedOff),
|
||||
onClick = {
|
||||
VideoPlayerObject.setAudioTrackIndex(-1)
|
||||
player.clearAudioTrack()
|
||||
},
|
||||
selected = -1 == selectedIndex
|
||||
selected = selectedOff
|
||||
) {
|
||||
Text(
|
||||
text = "Off",
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ fun SubtitlePicker(
|
|||
val listState = rememberLazyListState()
|
||||
|
||||
LaunchedEffect(selectedIndex) {
|
||||
if (selectedIndex == -1) return@LaunchedEffect
|
||||
listState.scrollToItem(
|
||||
subTitles.indexOfFirst { it.index == selectedIndex.toLong() }
|
||||
)
|
||||
|
|
@ -52,15 +53,16 @@ fun SubtitlePicker(
|
|||
verticalArrangement = Arrangement.spacedBy(6.dp)
|
||||
) {
|
||||
item {
|
||||
val selectedOff = -1 == selectedIndex
|
||||
TrackButton(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
.defaultSelected(-1 == selectedIndex),
|
||||
.defaultSelected(selectedOff),
|
||||
onClick = {
|
||||
VideoPlayerObject.setSubtitleTrackIndex(-1)
|
||||
player.clearSubtitleTrack()
|
||||
},
|
||||
selected = -1 == selectedIndex
|
||||
selected = selectedOff
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.Start,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue