|
|
|
@ -8,11 +8,17 @@ struct VoiceMessageView_SwiftUI: View {
|
|
|
|
|
@State var isPlaying: Bool = false
|
|
|
|
|
@State var time: String = "0:00"
|
|
|
|
|
@State var speed: String = "1.5×"
|
|
|
|
|
@State var progress: Double = 1.0
|
|
|
|
|
@State var progress: Double = 0.0
|
|
|
|
|
|
|
|
|
|
private static let width: CGFloat = 160
|
|
|
|
|
private static let toggleContainerSize: CGFloat = 20
|
|
|
|
|
|
|
|
|
|
private var attachment: Attachment
|
|
|
|
|
|
|
|
|
|
public init(attachment: Attachment) {
|
|
|
|
|
self.attachment = attachment
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var body: some View {
|
|
|
|
|
ZStack(alignment: .leading) {
|
|
|
|
|
Rectangle()
|
|
|
|
@ -40,6 +46,12 @@ struct VoiceMessageView_SwiftUI: View {
|
|
|
|
|
height: 8
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ActivityIndicator(themeColor: .textPrimary, width: 2)
|
|
|
|
|
// .frame(
|
|
|
|
|
// width: Self.toggleContainerSize,
|
|
|
|
|
// height: Self.toggleContainerSize
|
|
|
|
|
// )
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle()
|
|
|
|
@ -59,7 +71,7 @@ struct VoiceMessageView_SwiftUI: View {
|
|
|
|
|
.font(.system(size: Values.smallFontSize))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.padding(.horizontal, Values.smallSpacing)
|
|
|
|
|
.padding(.all, Values.smallSpacing)
|
|
|
|
|
}
|
|
|
|
|
.frame(
|
|
|
|
|
width: Self.width
|
|
|
|
@ -69,7 +81,7 @@ struct VoiceMessageView_SwiftUI: View {
|
|
|
|
|
|
|
|
|
|
struct VoiceMessageView_SwiftUI_Previews: PreviewProvider {
|
|
|
|
|
static var previews: some View {
|
|
|
|
|
VoiceMessageView_SwiftUI()
|
|
|
|
|
VoiceMessageView_SwiftUI(attachment: Attachment(variant: .voiceMessage, contentType: "mp4", byteCount: 100))
|
|
|
|
|
.frame(height: 58)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|