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,9 +93,11 @@ class AudioMessagePlaybackTracker @Inject constructor() {
|
|||
}
|
||||
|
||||
fun pausePlayback(id: String) {
|
||||
val currentPlaybackTime = getPlaybackTime(id)
|
||||
val currentPercentage = getPercentage(id)
|
||||
setState(id, Listener.State.Paused(currentPlaybackTime, currentPercentage))
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue