mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 08:03:50 +02:00
#4096 - Various small UI tweaks and bug fixes.
This commit is contained in:
@@ -45,7 +45,8 @@ class VoiceMessagePlaybackView: UIView, VoiceMessageAudioPlayerDelegate {
|
||||
|
||||
var attachment: MXKAttachment? {
|
||||
didSet {
|
||||
if oldValue?.contentURL == attachment?.contentURL {
|
||||
if oldValue?.contentURL == attachment?.contentURL &&
|
||||
oldValue?.eventSentState == attachment?.eventSentState {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -104,6 +105,10 @@ class VoiceMessagePlaybackView: UIView, VoiceMessageAudioPlayerDelegate {
|
||||
|
||||
// MARK: - VoiceMessageAudioPlayerDelegate
|
||||
|
||||
func audioPlayerDidFinishLoading(_ audioPlayer: VoiceMessageAudioPlayer) {
|
||||
updateUI()
|
||||
}
|
||||
|
||||
func audioPlayerDidStartPlaying(_ audioPlayer: VoiceMessageAudioPlayer) {
|
||||
state = .playing
|
||||
}
|
||||
@@ -143,7 +148,7 @@ class VoiceMessagePlaybackView: UIView, VoiceMessageAudioPlayerDelegate {
|
||||
|
||||
switch state {
|
||||
case .stopped:
|
||||
elapsedTimeLabel.text = timeFormatter.string(from: Date(timeIntervalSinceReferenceDate: 0.0))
|
||||
elapsedTimeLabel.text = timeFormatter.string(from: Date(timeIntervalSinceReferenceDate: audioPlayer.duration))
|
||||
waveformView.progress = 0.0
|
||||
default:
|
||||
elapsedTimeLabel.text = timeFormatter.string(from: Date(timeIntervalSinceReferenceDate: audioPlayer.currentTime))
|
||||
|
||||
Reference in New Issue
Block a user