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

Commit 7dffbd8f authored by Michael Mikhail's avatar Michael Mikhail
Browse files

Fix UMO visibility in two locations during transition in QS

When transitioning from QQS to QS, UMO is still visible in QQS while another UMO is visible on QS. Using same element key prevents Media from being visible in two locations at the same time.

Flag: com.android.systemui.media_controls_in_compose
Bug: 397989775
Test: Build, ui checked.
Change-Id: I63c4469abf8a19ac0b8d7e4c6b952f7c4b473c5a
parent 298837c0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1435,7 +1435,7 @@ private interface AnimatedColorScheme {
    val background: Color
}

private object Media {
object Media {

    /**
     * Scenes.
@@ -1481,6 +1481,7 @@ private object Media {
        val NextButton = ElementKey("next")
        val SeekBarSlider = ElementKey("seek_bar_slider")
        val OutputSwitcherButton = ElementKey("output_switcher")
        val mediaCarousel = ElementKey("media_carousel")

        fun additionalActionButton(index: Int): ElementKey {
            return ElementKey("additional_action_$index")
+10 −8
Original line number Diff line number Diff line
@@ -1391,7 +1391,7 @@ private fun Modifier.gesturesDisabled(disabled: Boolean) =
    }

@Composable
private fun MediaObject(
private fun ContentScope.MediaObject(
    mediaHost: MediaHost,
    modifier: Modifier = Modifier,
    mediaLogger: MediaViewLogger,
@@ -1401,13 +1401,15 @@ private fun MediaObject(
    update: UniqueObjectHostView.() -> Unit = {},
) {
    if (Flags.mediaControlsInCompose()) {
        Element(key = Media.Elements.mediaCarousel, modifier = modifier) {
            Media(
                viewModelFactory = mediaViewModelFactory,
                presentationStyle = MediaPresentationStyle.Default,
                behavior = behavior,
                onDismissed = { mediaCarouselInteractor.onSwipeToDismiss() },
            modifier = modifier,
                modifier = Modifier,
            )
        }
    } else {
        Box {
            AndroidView(