Merge pull request #7582 from vector-im/feature/fre/voice_message_persist_playback_state

Persist the playback state of voice messages across different screens
This commit is contained in:
Florian Renaud 2022-11-15 17:25:53 +01:00 committed by GitHub
commit 6fc8c2cb80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

1
changelog.d/7582.feature Normal file
View File

@ -0,0 +1 @@
Voice messages - Persist the playback position across different screens

View File

@ -253,8 +253,8 @@ class AudioMessageHelper @Inject constructor(
playbackTicker = null
}
fun clearTracker() {
playbackTracker.clear()
fun stopTracking() {
playbackTracker.unregisterListeners()
}
fun stopAllVoiceActions(deleteRecord: Boolean = true): MultiPickerAudioType? {

View File

@ -960,7 +960,7 @@ class MessageComposerViewModel @AssistedInject constructor(
}
fun endAllVoiceActions(deleteRecord: Boolean = true) {
audioMessageHelper.clearTracker()
audioMessageHelper.stopTracking()
audioMessageHelper.stopAllVoiceActions(deleteRecord)
}

View File

@ -136,12 +136,11 @@ class AudioMessagePlaybackTracker @Inject constructor() {
}
}
fun clear() {
fun unregisterListeners() {
listeners.forEach {
it.value.onUpdate(Listener.State.Idle)
}
listeners.clear()
states.clear()
}
companion object {