mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Mirror playback icons for RTL
This commit is contained in:
parent
bd767c570b
commit
7ff4b0cf10
1 changed files with 7 additions and 4 deletions
|
|
@ -42,10 +42,12 @@ import androidx.compose.ui.focus.onFocusChanged
|
|||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.isSpecified
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.platform.LocalView
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.style.TextAlign
|
||||
import androidx.compose.ui.unit.LayoutDirection
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.ui.window.Dialog
|
||||
|
|
@ -368,12 +370,13 @@ fun PlaybackButtons(
|
|||
seekForward: Duration,
|
||||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
val isLtr = LocalLayoutDirection.current == LayoutDirection.Ltr
|
||||
Row(
|
||||
modifier = modifier.focusGroup(),
|
||||
horizontalArrangement = Arrangement.spacedBy(buttonSpacing),
|
||||
) {
|
||||
PlaybackButton(
|
||||
iconRes = R.drawable.baseline_skip_previous_24,
|
||||
iconRes = if (isLtr) R.drawable.baseline_skip_previous_24 else R.drawable.baseline_skip_next_24,
|
||||
onClick = {
|
||||
onControllerInteraction.invoke()
|
||||
onPlaybackActionClick.invoke(PlaybackAction.Previous)
|
||||
|
|
@ -382,7 +385,7 @@ fun PlaybackButtons(
|
|||
onControllerInteraction = onControllerInteraction,
|
||||
)
|
||||
PlaybackButton(
|
||||
iconRes = R.drawable.baseline_fast_rewind_24,
|
||||
iconRes = if (isLtr) R.drawable.baseline_fast_rewind_24 else R.drawable.baseline_fast_forward_24,
|
||||
onClick = {
|
||||
onControllerInteraction.invoke()
|
||||
player.seekBack(seekBack)
|
||||
|
|
@ -406,7 +409,7 @@ fun PlaybackButtons(
|
|||
onControllerInteraction = onControllerInteraction,
|
||||
)
|
||||
PlaybackButton(
|
||||
iconRes = R.drawable.baseline_fast_forward_24,
|
||||
iconRes = if (isLtr) R.drawable.baseline_fast_forward_24 else R.drawable.baseline_fast_rewind_24,
|
||||
onClick = {
|
||||
onControllerInteraction.invoke()
|
||||
player.seekForward(seekForward)
|
||||
|
|
@ -414,7 +417,7 @@ fun PlaybackButtons(
|
|||
onControllerInteraction = onControllerInteraction,
|
||||
)
|
||||
PlaybackButton(
|
||||
iconRes = R.drawable.baseline_skip_next_24,
|
||||
iconRes = if (isLtr) R.drawable.baseline_skip_next_24 else R.drawable.baseline_skip_previous_24,
|
||||
onClick = {
|
||||
onControllerInteraction.invoke()
|
||||
onPlaybackActionClick.invoke(PlaybackAction.Next)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue