mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 03:48:12 +03:00
Persist the playback state of voice messages across different screens
This commit is contained in:
parent
d9454af63e
commit
dca379b80f
3 changed files with 4 additions and 5 deletions
|
@ -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 a new issue