Fix: Keep the progress indicator visible after pausing or scrubbing a voice message. (#1969)

This commit is contained in:
Nicolas Mauri
2023-10-27 17:24:22 +02:00
committed by GitHub
parent 0b31446817
commit a32a7c8f2c
12 changed files with 110 additions and 23 deletions
@@ -35,11 +35,6 @@ private struct WaveformInteractionModifier: ViewModifier {
func body(content: Content) -> some View {
GeometryReader { geometry in
content
.gesture(SpatialTapGesture()
.onEnded { tapGesture in
let progress = tapGesture.location.x / geometry.size.width
onSeek(max(0, min(progress, 1.0)))
})
.progressCursor(progress: progress) {
WaveformCursorView(color: .compound.iconAccentTertiary)
.frame(width: cursorVisibleWidth, height: cursorVisibleHeight)
@@ -56,6 +51,11 @@ private struct WaveformInteractionModifier: ViewModifier {
)
.offset(x: -cursorInteractiveSize / 2, y: 0)
}
.gesture(SpatialTapGesture()
.onEnded { tapGesture in
let progress = tapGesture.location.x / geometry.size.width
onSeek(max(0, min(progress, 1.0)))
})
}
.coordinateSpace(name: Self.namespaceName)
.animation(nil, value: progress)