getting legit button feel to the record button
This commit is contained in:
@@ -15,42 +15,20 @@ struct FooterControlsView: View {
|
|||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
Image(systemName: viewModel.isRecording ? "waveform" : "mic.fill")
|
Button(action: {
|
||||||
.foregroundColor(.white)
|
print("pressed button")
|
||||||
.padding()
|
}) {
|
||||||
.background(NirvanaColor.teal)
|
Image(systemName: viewModel.isRecording ? "waveform" : "mic.fill")
|
||||||
.clipShape(Circle())
|
.foregroundColor(.white)
|
||||||
.shadow(radius: 10)
|
.padding()
|
||||||
// .scaleEffect(self.scaleValue)
|
.background(NirvanaColor.teal)
|
||||||
.onLongPressGesture {
|
.clipShape(Circle())
|
||||||
|
.shadow(radius: 10)
|
||||||
}
|
|
||||||
.animation(.linear(duration:2), value: viewModel.isRecording)
|
|
||||||
.onTapGesture {
|
|
||||||
viewModel.onStartRecording()
|
|
||||||
print("tap gesture active")
|
|
||||||
}
|
|
||||||
// .onTapGesture(
|
|
||||||
// touchBegan: {
|
|
||||||
// withAnimation {
|
|
||||||
// self.scaleValue = 1.2
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// viewModel.onStartRecording()
|
|
||||||
//
|
|
||||||
// print("long press active")
|
|
||||||
// }, touchEnd: {_ in
|
|
||||||
// withAnimation {
|
|
||||||
// self.scaleValue = 1.0
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// print("long press not active anymore")
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
.padding()
|
|
||||||
}
|
}
|
||||||
|
.padding()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct FooterControlsView_Previews: PreviewProvider {
|
struct FooterControlsView_Previews: PreviewProvider {
|
||||||
|
|||||||
Reference in New Issue
Block a user