mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Voice message UI polish (part 2) (#1995)
* Update compund * Fix create poll screen bin button style * Fix timeline menu description for voice messages * Fix bin button in ComposerToolbar * Add VoiceMessageButtonStyle * Update compound & fix breaking changes * Fix voice message bin size * Refactor VoiceMessageRecordingButton * Fix preview tests
This commit is contained in:
@@ -53,7 +53,7 @@ struct VoiceMessageButton: View {
|
||||
.frame(width: buttonSize, height: buttonSize)
|
||||
}
|
||||
.animation(nil, value: state)
|
||||
.buttonStyle(.plain)
|
||||
.buttonStyle(VoiceMessageButtonStyle())
|
||||
.disabled(state == .loading)
|
||||
.background(Circle().foregroundColor(.compound.bgCanvasDefault))
|
||||
}
|
||||
@@ -73,12 +73,20 @@ struct VoiceMessageButton: View {
|
||||
.scaledToFit()
|
||||
.frame(width: imageWidth, height: imageHeight)
|
||||
.offset(x: offset)
|
||||
.foregroundColor(.compound.iconSecondary)
|
||||
.accessibilityLabel(accessibilityLabel)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct VoiceMessageButtonStyle: ButtonStyle {
|
||||
@Environment(\.isEnabled) var isEnabled: Bool
|
||||
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
.foregroundColor(isEnabled ? .compound.textSecondary.opacity(configuration.isPressed ? 0.6 : 1) : .compound.iconDisabled)
|
||||
}
|
||||
}
|
||||
|
||||
extension VoiceMessageButton.State {
|
||||
init(state: AudioPlayerPlaybackState) {
|
||||
switch state {
|
||||
|
||||
Reference in New Issue
Block a user