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

Commit 10d0d0cb authored by Fabián Kozynski's avatar Fabián Kozynski
Browse files

Avoid media updates due to changing constraints

In QQS we want media to take as much space as possible. As the column is
bounded, when the tiles change size due to squishiness, we don't want
the constraints to media change (unbounded) as it will wrap to its size.

Therefore, we pass a requiredHeight max of infinity.

Test: manual, perfetto traces to see that media is not being updated on
expansion
Bug: 383085298
Flag: com.android.systemui.qs_ui_refactor_compose_fragment

Change-Id: Id85fef7b3e38a9f271d549e7142139b76a5161e6
parent a17d435d
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.requiredHeightIn
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
@@ -77,6 +78,7 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.CustomAccessibilityAction
import androidx.compose.ui.semantics.customActions
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.round
@@ -622,7 +624,14 @@ constructor(
                val Media =
                    @Composable {
                        if (viewModel.qqsMediaVisible) {
                            MediaObject(mediaHost = viewModel.qqsMediaHost)
                            MediaObject(
                                // In order to have stable constraints passed to the AndroidView
                                // during expansion (available height changing due to squishiness),
                                // We always allow the media here to be as tall as it wants.
                                // (b/383085298)
                                modifier = Modifier.requiredHeightIn(max = Dp.Infinity),
                                mediaHost = viewModel.qqsMediaHost,
                            )
                        }
                    }