Skip to content

Commit

Permalink
improve example completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
dmrschmidt committed Oct 8, 2023
1 parent 78635ad commit 730021f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import DSWaveformImageViews
struct RecordingIndicatorView: View {
let samples: [Float]
let duration: TimeInterval
let shouldDrawSilence: Bool

@Binding var isRecording: Bool

Expand All @@ -22,7 +23,7 @@ struct RecordingIndicatorView: View {

var body: some View {
HStack {
WaveformLiveCanvas(samples: samples, configuration: configuration)
WaveformLiveCanvas(samples: samples, configuration: configuration, shouldDrawSilencePadding: shouldDrawSilence)
.padding(.vertical, 2)

Text(Self.timeFormatter.string(from: duration) ?? "00:00")
Expand All @@ -48,7 +49,7 @@ struct RecordingIndicatorView: View {
#if DEBUG
struct RecordingIndicatorView_Previews: PreviewProvider {
static var previews: some View {
RecordingIndicatorView(samples: [], duration: 120, isRecording: .constant(true))
RecordingIndicatorView(samples: [], duration: 120, shouldDrawSilence: true, isRecording: .constant(true))
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ struct SwiftUIExampleView: View {
RecordingIndicatorView(
samples: audioRecorder.samples,
duration: audioRecorder.recordingTime,
shouldDrawSilence: silence,
isRecording: $audioRecorder.isRecording
)
.padding(.horizontal)
Expand Down

0 comments on commit 730021f

Please sign in to comment.