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:
commit
6fc8c2cb80
|
@ -0,0 +1 @@
|
|||
Voice messages - Persist the playback position across different screens
|
|
@ -253,8 +253,8 @@ class AudioMessageHelper @Inject constructor(
|
|||
playbackTicker = null
|
||||
}
|
||||
|
||||
fun clearTracker() {
|
||||
playbackTracker.clear()
|
||||
fun stopTracking() {
|
||||
playbackTracker.unregisterListeners()
|
||||
}
|
||||
|
||||
fun stopAllVoiceActions(deleteRecord: Boolean = true): MultiPickerAudioType? {
|
||||
|
|
|
@ -960,7 +960,7 @@ class MessageComposerViewModel @AssistedInject constructor(
|
|||
}
|
||||
|
||||
fun endAllVoiceActions(deleteRecord: Boolean = true) {
|
||||
audioMessageHelper.clearTracker()
|
||||
audioMessageHelper.stopTracking()
|
||||
audioMessageHelper.stopAllVoiceActions(deleteRecord)
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue