mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 09:56:00 +03:00
ignoring duplicated state updates
This commit is contained in:
parent
9e9116df2f
commit
034725ef91
1 changed files with 3 additions and 0 deletions
|
@ -75,11 +75,14 @@ class RoomDetailActivity :
|
|||
}
|
||||
}
|
||||
|
||||
private var lastKnownPlayingOrRecordingState: Boolean? = null
|
||||
private val playbackActivityListener = VoiceMessagePlaybackTracker.ActivityListener { isPlayingOrRecording ->
|
||||
if (lastKnownPlayingOrRecordingState == isPlayingOrRecording) return@ActivityListener
|
||||
when (isPlayingOrRecording) {
|
||||
true -> keepScreenOn()
|
||||
false -> endKeepScreenOn()
|
||||
}
|
||||
lastKnownPlayingOrRecordingState = isPlayingOrRecording
|
||||
}
|
||||
|
||||
override fun getCoordinatorLayout() = views.coordinatorLayout
|
||||
|
|
Loading…
Reference in a new issue