Skip to content

Commit 431fd78

Browse files
authored
Voice Memos Fixes (#316)
1 parent 0190f03 commit 431fd78

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

Examples/VoiceMemos/VoiceMemos/VoiceMemo.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ struct VoiceMemoView: View {
120120
ZStack(alignment: .leading) {
121121
if self.viewStore.mode.isPlaying {
122122
Rectangle()
123-
.foregroundColor(Color(white: 0.9))
123+
.foregroundColor(Color(.systemGray5))
124124
.frame(width: proxy.size.width * CGFloat(self.viewStore.mode.progress ?? 0))
125125
.animation(.linear(duration: 0.5))
126126
}
@@ -137,19 +137,20 @@ struct VoiceMemoView: View {
137137
dateComponentsFormatter.string(from: self.currentTime).map {
138138
Text($0)
139139
.font(Font.footnote.monospacedDigit())
140-
.foregroundColor(.gray)
140+
.foregroundColor(Color(.systemGray))
141141
}
142142

143143
Button(action: { self.viewStore.send(.playButtonTapped) }) {
144144
Image(systemName: self.viewStore.mode.isPlaying ? "stop.circle" : "play.circle")
145145
.font(Font.system(size: 22))
146146
}
147147
}
148+
.frame(maxHeight: .infinity, alignment: .center)
148149
.padding([.leading, .trailing])
149150
}
150151
}
151152
.buttonStyle(BorderlessButtonStyle())
152-
.listRowBackground(self.viewStore.mode.isPlaying ? Color(white: 0.97) : .clear)
153+
.listRowBackground(self.viewStore.mode.isPlaying ? Color(.systemGray6) : .clear)
153154
.listRowInsets(EdgeInsets())
154155
}
155156

Examples/VoiceMemos/VoiceMemos/VoiceMemos.swift

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,19 @@ struct VoiceMemosView: View {
207207
VStack {
208208
ZStack {
209209
Circle()
210-
.foregroundColor(.black)
210+
.foregroundColor(Color(.label))
211211
.frame(width: 74, height: 74)
212212

213-
Button(action: { viewStore.send(.recordButtonTapped) }) {
213+
Button(
214+
action: {
215+
withAnimation(.spring()) {
216+
viewStore.send(.recordButtonTapped)
217+
}
218+
}
219+
) {
214220
RoundedRectangle(cornerRadius: viewStore.currentRecording != nil ? 4 : 35)
215-
.foregroundColor(.red)
221+
.foregroundColor(Color(.systemRed))
216222
.padding(viewStore.currentRecording != nil ? 17 : 2)
217-
.animation(.spring())
218223
}
219224
.frame(width: 70, height: 70)
220225

@@ -234,13 +239,12 @@ struct VoiceMemosView: View {
234239
Text($0)
235240
.font(Font.body.monospacedDigit().bold())
236241
.foregroundColor(.white)
237-
.colorMultiply(Int(duration).isMultiple(of: 2) ? .red : .black)
242+
.colorMultiply(Color(Int(duration).isMultiple(of: 2) ? .systemRed : .label))
238243
.animation(.easeInOut(duration: 0.5))
239244
}
240245
}
241246
}
242247
.padding()
243-
.animation(Animation.easeInOut(duration: 0.3))
244248
}
245249
.alert(
246250
self.store.scope(state: { $0.alert }),
@@ -293,5 +297,6 @@ struct VoiceMemos_Previews: PreviewProvider {
293297
)
294298
)
295299
)
300+
.environment(\.colorScheme, .dark)
296301
}
297302
}

0 commit comments

Comments
 (0)