mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add a progress indicator to voice message preview (#1956)
This commit is contained in:
+7
-12
@@ -74,18 +74,13 @@ struct VoiceMessageRoomPlaybackView: View {
|
||||
.monospacedDigit()
|
||||
.fixedSize(horizontal: true, vertical: true)
|
||||
}
|
||||
GeometryReader { geometry in
|
||||
waveformView
|
||||
.overlay(alignment: .leading) {
|
||||
// Display a cursor
|
||||
RoundedRectangle(cornerRadius: 1)
|
||||
.fill(Color.compound.iconAccentTertiary)
|
||||
.offset(CGSize(width: playerState.progress * geometry.size.width, height: 0.0))
|
||||
.frame(width: waveformLineWidth, height: geometry.size.height)
|
||||
.opacity(showWaveformCursor ? 1 : 0)
|
||||
}
|
||||
.waveformDragGesture($dragState)
|
||||
}
|
||||
waveformView
|
||||
.waveformDragGesture($dragState)
|
||||
.progressCursor(progress: playerState.progress) {
|
||||
WaveformCursorView(color: .compound.iconAccentTertiary)
|
||||
.opacity(showWaveformCursor ? 1 : 0)
|
||||
.frame(width: waveformLineWidth)
|
||||
}
|
||||
}
|
||||
.onChange(of: dragState) { newDragState in
|
||||
switch newDragState {
|
||||
|
||||
Reference in New Issue
Block a user