Adopted Liquid Glass effect for the buttons of the RecordingView view in the Recording package target.
This commit is contained in:
@@ -48,6 +48,7 @@ public struct RecordingView: View {
|
||||
Text(model.textTimer)
|
||||
.font(.largeTitle)
|
||||
.fontWeight(.bold)
|
||||
.foregroundStyle(.primary)
|
||||
.monospacedDigit()
|
||||
.contentTransition(.numericText())
|
||||
.animation(
|
||||
@@ -56,35 +57,40 @@ public struct RecordingView: View {
|
||||
)
|
||||
}
|
||||
|
||||
HStack(
|
||||
spacing: Constant.Spacing.stack
|
||||
) {
|
||||
Button {
|
||||
model.pressedMain()
|
||||
} label: {
|
||||
Image(model.iconMain)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
}
|
||||
.disabled(model.shouldDisableMain)
|
||||
|
||||
if model.shouldShowSend {
|
||||
GlassEffectContainer {
|
||||
HStack(
|
||||
spacing: Constant.Spacing.stack
|
||||
) {
|
||||
Button {
|
||||
model.pressedSend()
|
||||
model.pressedMain()
|
||||
} label: {
|
||||
if let icon = model.iconSend {
|
||||
Image(icon)
|
||||
.resizable()
|
||||
} else {
|
||||
ProgressView()
|
||||
Image(model.iconMain)
|
||||
.resizable()
|
||||
.scaledToFit()
|
||||
}
|
||||
.buttonStyle(.recording(
|
||||
invertStyle: true
|
||||
))
|
||||
.disabled(model.shouldDisableMain)
|
||||
|
||||
if model.shouldShowSend {
|
||||
Button {
|
||||
model.pressedSend()
|
||||
} label: {
|
||||
if let icon = model.iconSend {
|
||||
Image(icon)
|
||||
.resizable()
|
||||
} else {
|
||||
ProgressView()
|
||||
}
|
||||
}
|
||||
.buttonStyle(.recording(
|
||||
invertStyle: !model.isProcessing
|
||||
))
|
||||
.disabled(model.isProcessing)
|
||||
}
|
||||
.disabled(model.isProcessing)
|
||||
}
|
||||
}
|
||||
.buttonStyle(.recording(
|
||||
invertStyle: !model.isProcessing
|
||||
))
|
||||
}
|
||||
.onChange(
|
||||
of: model.state,
|
||||
|
||||
Reference in New Issue
Block a user