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

Commit b494918d authored by Evan Laird's avatar Evan Laird
Browse files

[mobile] request layout when size changes

The bug: the stacked mobile icon's outer view was not re-measuring when
the inner compose view changed width. Therefore, the icon was sometimes
clipped.

The fix: request layout when the size changes.

Test: manual; have 2 real, working SIMS, turn off wi-fi and toggle
airplane mode from the settings app. If the stacked mobile view comes
back and properly shows the RAT indicator (e.g., 5G) without any
clipping, then it's fixed.
Fixes: 406832105
Flag: com.android.settingslib.flags.new_status_bar_icons
Flag: com.android.systemui.status_bar_root_modernization

Change-Id: I49922bde8d13b218bbf244baaf0abf772a7deda3
parent b8f396ee
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@ package com.android.systemui.statusbar.pipeline.mobile.ui.binder
import androidx.compose.material3.LocalContentColor
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.ViewCompositionStrategy
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -74,7 +76,10 @@ object StackedMobileIconBinder {
                            val tint by tintFlow.collectAsStateWithLifecycle()
                            if (viewModel.isIconVisible) {
                                CompositionLocalProvider(LocalContentColor provides Color(tint)) {
                                    StackedMobileIcon(viewModel)
                                    StackedMobileIcon(
                                        viewModel,
                                        modifier = Modifier.onSizeChanged { view.requestLayout() },
                                    )
                                }
                            }
                        }