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

Commit bd2962bd authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[flexiglass] Temporarily avoid relying on WindowInsets for ShadeHeader

This was introduced in ag/33290385, but due to a window layout param
we're currently getting 0 insets at the top. This will be fixed properly
in a follow-up CL.

Fix: 414424531
Bug: 414737230
Test: Manually by opening the shade on an unfolded foldable device where
 the problem appeared.
Flag: com.android.systemui.scene_container
Change-Id: I2886608b28a1822fb39ce1fe35feccc5943e80d1
parent a60982ac
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -32,15 +32,12 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxSize
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.statusBars
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.shape.RoundedCornerShape
@@ -64,6 +61,7 @@ import androidx.compose.ui.layout.positionInWindow
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.dimensionResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Dp
@@ -138,7 +136,9 @@ object ShadeHeader {
        val ChipPaddingVertical = 4.dp

        val StatusBarHeight: Dp
            @Composable get() = WindowInsets.statusBars.asPaddingValues().calculateTopPadding()
            // TODO(b/414737230): This is a temporary workaround, until we fix the zero padding
            //  issue given by WindowInsets.statusBars.asPaddingValues().calculateTopPadding().
            @Composable get() = dimensionResource(R.dimen.status_bar_height)
    }

    object TestTags {