Fixes bugs related to audio message duration being set incorrectly between activity states
This commit is contained in:
parent
cc5e8f35a7
commit
6adf4878f7
|
@ -900,6 +900,7 @@ class TimelineFragment @Inject constructor(
|
|||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
audioMessagePlaybackTracker.makeAllPlaybacksIdle()
|
||||
lazyLoadedViews.unBind()
|
||||
timelineEventController.callback = null
|
||||
timelineEventController.removeModelBuildListener(modelBuildListener)
|
||||
|
|
|
@ -93,10 +93,12 @@ class AudioMessagePlaybackTracker @Inject constructor() {
|
|||
}
|
||||
|
||||
fun pausePlayback(id: String) {
|
||||
if (getPlaybackState(id) is Listener.State.Playing) {
|
||||
val currentPlaybackTime = getPlaybackTime(id)
|
||||
val currentPercentage = getPercentage(id)
|
||||
setState(id, Listener.State.Paused(currentPlaybackTime, currentPercentage))
|
||||
}
|
||||
}
|
||||
|
||||
fun stopPlayback(id: String) {
|
||||
setState(id, Listener.State.Idle)
|
||||
|
|
Loading…
Reference in New Issue