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

Commit 72f516e5 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Chips] Let chip accomodate taller languages if needed.

R.dimen.ongoing_appops_chip_height was enough space for most languages,
but not all languages (like my-MM locale). This CL makes the chip have a
minimum height of ongoing_appops_chip_height, but also allows it to grow
larger if the ChipContent needs to be larger.

Fixes: 410895832
Bug: 372657935
Flag: com.android.systemui.status_bar_chips_modernization
Test: atest OngoingActivityChipsComposeScreenshotTest (screenshots
shouldn't change)
Test: verify chip adjusts in height based on language, but never goes
below ongoing_appops_chip_height

Change-Id: Ic9fdaee4daed3d00e4ae16e781058502a59092bd
parent 9a04fbfe
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -24,11 +24,12 @@ import android.widget.FrameLayout
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.heightIn
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@@ -107,7 +108,7 @@ fun OngoingActivityChip(
            RoundedCornerShape(dimensionResource(id = R.dimen.ongoing_activity_chip_corner_radius)),
        modifier =
            modifier
                .height(dimensionResource(R.dimen.ongoing_appops_chip_height))
                .wrapContentSize()
                .semantics {
                    if (contentDescription != null) {
                        this.contentDescription = contentDescription
@@ -161,7 +162,7 @@ private fun ChipBody(
        verticalAlignment = Alignment.CenterVertically,
        modifier =
            modifier
                .fillMaxHeight()
                .heightIn(min = dimensionResource(R.dimen.ongoing_appops_chip_height))
                // Set the minWidth here as well as on the Expandable so that the content within
                // this row is still centered correctly horizontally
                .widthIn(min = minWidth)