Replace the player timeline

This commit is contained in:
Philippe Loriaux
2022-12-14 10:34:43 +01:00
parent b6e0cdaa6f
commit ad0ecfb843
11 changed files with 173 additions and 13 deletions
@@ -152,15 +152,23 @@ struct VoiceBroadcastPlaybackView: View {
}
}
Slider(value: $viewModel.progress, in: 0...viewModel.viewState.playingState.duration) {
Text("Slider")
} minimumValueLabel: {
Text("")
} maximumValueLabel: {
Text(viewModel.viewState.playingState.durationLabel ?? "").font(.body)
} onEditingChanged: { didChange in
VoiceBroadcastSlider(value: $viewModel.progress,
minValue: 0.0,
maxValue: viewModel.viewState.playingState.duration) { didChange in
viewModel.send(viewAction: .sliderChange(didChange: didChange))
}
HStack {
Text(viewModel.viewState.playingState.elapsedTimeLabel ?? "")
.foregroundColor(theme.colors.secondaryContent)
.font(theme.fonts.caption1)
.padding(EdgeInsets(top: -4.0, leading: 4.0, bottom: 0.0, trailing: 0.0))
Spacer()
Text(viewModel.viewState.playingState.remainingTimeLabel ?? "")
.foregroundColor(theme.colors.secondaryContent)
.font(theme.fonts.caption1)
.padding(EdgeInsets(top: -4.0, leading: 0.0, bottom: 0.0, trailing: 4.0))
}
}
.padding([.horizontal, .top], 2.0)
.padding([.bottom])