Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b365ae7 authored by Anton Potapov's avatar Anton Potapov
Browse files

Make open-close animation wait for the previous one to finish instead of interrupting it

Flag: com.android.systemui.volume_redesign
Fixes: b/420526565
Test: manual on the foldable. Open-close volume dialog in a quick succession

Change-Id: I3036a37f324763f950b4580b3cb1231c1521f9ce
parent 7cfe707c
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -49,8 +49,8 @@ import kotlin.math.ceil
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.conflate
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.mapLatest
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.scan
import kotlinx.coroutines.suspendCancellableCoroutine
@@ -162,7 +162,8 @@ constructor(
        var junkListener: DynamicAnimation.OnAnimationUpdateListener? = null

        visibilityModel
            .mapLatest {
            .conflate()
            .onEach {
                when (it) {
                    is VolumeDialogVisibilityModel.Visible -> {
                        tracer.traceVisibilityEnd(it)