diff --git a/.phrasey/schema.toml b/.phrasey/schema.toml index 48cb980c..16b5613a 100644 --- a/.phrasey/schema.toml +++ b/.phrasey/schema.toml @@ -423,7 +423,10 @@ name = "Codec" name = "ControlsLayout" [[keys]] -name = "Default" +name = "CompactLeft" + +[[keys]] +name = "CompactRight" [[keys]] name = "Traditional" diff --git a/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt b/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt index 13226de2..96109d1b 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/services/Settings.kt @@ -296,7 +296,7 @@ class Settings(private val symphony: Symphony) { val nowPlayingControlsLayout = EnumEntry( "now_playing_controls_layout", enumEntries(), - NowPlayingControlsLayout.Default, + NowPlayingControlsLayout.CompactLeft, ) val showUpdateToast = BooleanEntry("show_update_toast", true) val fontScale = FloatEntry("font_scale", 1f) diff --git a/app/src/main/java/io/github/zyrouge/symphony/ui/view/NowPlaying.kt b/app/src/main/java/io/github/zyrouge/symphony/ui/view/NowPlaying.kt index c05e6179..8646a476 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/ui/view/NowPlaying.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/ui/view/NowPlaying.kt @@ -45,7 +45,8 @@ object NowPlayingDefaults { } enum class NowPlayingControlsLayout { - Default, + CompactLeft, + CompactRight, Traditional, } diff --git a/app/src/main/java/io/github/zyrouge/symphony/ui/view/nowPlaying/BodyContent.kt b/app/src/main/java/io/github/zyrouge/symphony/ui/view/nowPlaying/BodyContent.kt index 7ac36f66..68e36687 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/ui/view/nowPlaying/BodyContent.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/ui/view/nowPlaying/BodyContent.kt @@ -163,48 +163,16 @@ fun NowPlayingBodyContent(context: ViewContext, data: NowPlayingData) { } Spacer(modifier = Modifier.height(defaultHorizontalPadding + 8.dp)) when (controlsLayout) { - NowPlayingControlsLayout.Default -> Row( - modifier = Modifier.padding(defaultHorizontalPadding, 0.dp), - horizontalArrangement = Arrangement.spacedBy(12.dp), - ) { - NowPlayingPlayPauseButton( - context, - data = data, - style = NowPlayingControlButtonStyle( - color = NowPlayingControlButtonColor.Primary, - ), - ) - NowPlayingSkipPreviousButton( - context, - data = data, - style = NowPlayingControlButtonStyle( - color = NowPlayingControlButtonColor.Surface, - ), - ) - if (enableSeekControls) { - NowPlayingFastRewindButton( - context, - data = data, - style = NowPlayingControlButtonStyle( - color = NowPlayingControlButtonColor.Surface, - ), - ) - NowPlayingFastForwardButton( - context, - data = data, - style = NowPlayingControlButtonStyle( - color = NowPlayingControlButtonColor.Surface, - ), - ) - } - NowPlayingSkipNextButton( - context, - data = data, - style = NowPlayingControlButtonStyle( - color = NowPlayingControlButtonColor.Surface, - ), - ) - } + NowPlayingControlsLayout.CompactLeft -> NowPlayingCompactControls( + context, + data = data + ) + + NowPlayingControlsLayout.CompactRight -> NowPlayingCompactControls( + context, + data = data, + modifier = Modifier.align(Alignment.End) + ) NowPlayingControlsLayout.Traditional -> NowPlayingTraditionalControls( context, @@ -218,6 +186,56 @@ fun NowPlayingBodyContent(context: ViewContext, data: NowPlayingData) { } } +@Composable +fun NowPlayingCompactControls( + context: ViewContext, + data: NowPlayingData, + modifier: Modifier = Modifier, +) { + Row( + modifier = modifier.padding(defaultHorizontalPadding, 0.dp), + horizontalArrangement = Arrangement.spacedBy(12.dp), + ) { + NowPlayingPlayPauseButton( + context, + data = data, + style = NowPlayingControlButtonStyle( + color = NowPlayingControlButtonColor.Primary, + ), + ) + NowPlayingSkipPreviousButton( + context, + data = data, + style = NowPlayingControlButtonStyle( + color = NowPlayingControlButtonColor.Surface, + ), + ) + if (data.enableSeekControls) { + NowPlayingFastRewindButton( + context, + data = data, + style = NowPlayingControlButtonStyle( + color = NowPlayingControlButtonColor.Surface, + ), + ) + NowPlayingFastForwardButton( + context, + data = data, + style = NowPlayingControlButtonStyle( + color = NowPlayingControlButtonColor.Surface, + ), + ) + } + NowPlayingSkipNextButton( + context, + data = data, + style = NowPlayingControlButtonStyle( + color = NowPlayingControlButtonColor.Surface, + ), + ) + } +} + @Composable fun NowPlayingTraditionalControls(context: ViewContext, data: NowPlayingData) { Row( diff --git a/app/src/main/java/io/github/zyrouge/symphony/ui/view/settings/NowPlayingSettingsView.kt b/app/src/main/java/io/github/zyrouge/symphony/ui/view/settings/NowPlayingSettingsView.kt index cea9a716..b62f6c27 100644 --- a/app/src/main/java/io/github/zyrouge/symphony/ui/view/settings/NowPlayingSettingsView.kt +++ b/app/src/main/java/io/github/zyrouge/symphony/ui/view/settings/NowPlayingSettingsView.kt @@ -160,7 +160,8 @@ fun NowPlayingSettingsView(context: ViewContext) { } fun NowPlayingControlsLayout.label(context: ViewContext) = when (this) { - NowPlayingControlsLayout.Default -> context.symphony.t.Default + NowPlayingControlsLayout.CompactLeft -> context.symphony.t.CompactLeft + NowPlayingControlsLayout.CompactRight -> context.symphony.t.CompactRight NowPlayingControlsLayout.Traditional -> context.symphony.t.Traditional } diff --git a/i18n/en.toml b/i18n/en.toml index a5500fa6..ce83b1f1 100644 --- a/i18n/en.toml +++ b/i18n/en.toml @@ -150,7 +150,8 @@ ShowSeekControls = "Show seek controls" Font = "Font" Codec = "Codec" ControlsLayout = "Controls layout" -Default = "Default" +CompactLeft = "Compact (left)" +CompactRight = "Compact (right)" Traditional = "Traditional" Enabled = "Enabled" Disabled = "Disabled"