Music widget: add preference to make progress bar non-interactive
This commit is contained in:
@@ -119,7 +119,7 @@ fun ConfigureWidgetSheet(
|
||||
is AppWidget -> ConfigureAppWidget(widget, onWidgetUpdated)
|
||||
is CalendarWidget -> ConfigureCalendarWidget(widget, onWidgetUpdated)
|
||||
is FavoritesWidget -> ConfigureFavoritesWidget(widget, onWidgetUpdated)
|
||||
is MusicWidget -> ConfigureMusicWidget()
|
||||
is MusicWidget -> ConfigureMusicWidget(widget, onWidgetUpdated)
|
||||
is NotesWidget -> ConfigureNotesWidget(widget, onWidgetUpdated)
|
||||
}
|
||||
}
|
||||
@@ -232,10 +232,27 @@ fun ColumnScope.ConfigureFavoritesWidget(
|
||||
|
||||
@Composable
|
||||
fun ColumnScope.ConfigureMusicWidget(
|
||||
widget: MusicWidget,
|
||||
onWidgetUpdated: (MusicWidget) -> Unit,
|
||||
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
|
||||
OutlinedCard {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
SwitchPreference(
|
||||
title = stringResource(R.string.music_widget_interactive_progress_bar),
|
||||
iconPadding = false,
|
||||
value = widget.config.interactiveProgressBar,
|
||||
onValueChanged = {
|
||||
onWidgetUpdated(widget.copy(config = widget.config.copy(interactiveProgressBar = it)))
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
TextButton(
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterHorizontally),
|
||||
|
||||
@@ -168,7 +168,7 @@ fun MusicWidget(widget: MusicWidget) {
|
||||
var seekPosition by remember { mutableStateOf<Float?>(null) }
|
||||
|
||||
if (pos != null && dur != null && dur > 0) {
|
||||
if (playbackState != PlaybackState.Stopped || supportedActions.seekTo) {
|
||||
if (playbackState != PlaybackState.Stopped && supportedActions.seekTo && widget.config.interactiveProgressBar) {
|
||||
Slider(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
||||
Reference in New Issue
Block a user