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

Commit a765eda7 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Chips] Fix chip sizings, paddings, and visibility.

1. `Expandable` was enforcing a minimum width of 40.dp even if the chip
   wasn't clickable, which is still too big for the 3-2-1 countdown
   chip. Now, `Expandable` has a new `defaultMinSize` parameter which
   can be set to false to not enforce that 40.dp minimum width.

2. ag/32020945 accidentally removed the `.thenIf(isClickable) {
   Modifier.widthIn(min = minWidth) }` line, which meant that icon-only
   chips were too small (they should've been 48.dp, but they were only
   40.dp) and there was too much spacing between the icon-only chips.

3. We need to hide a chip completely if there isn't enough room for it.
   That's done via the `.layout {}` modifier. This CL moves that
   modifier out of the ChipBody composable and into the parent
   Expandable composable, which ensures we definitely don't show
   anything.

Fixes: 402083504
Bug: 372657935
Flag: com.android.systemui.status_bar_chips_modernization
Test: Trigger SysUI screen recording -> verify 3-2-1 countdown chip has
small width
Test: Trigger 2 chips on a portrait phone -> verify each chip is 48dp
wide with minimum padding between
Test: Trigger 3 different chips on a portrait phone -> verify the third
chip never shows up, not even cropped

Test: Verify b/397505143 is still fixed
Test: Verify chip -> dialog animation still looks correct
Test: General smoke test of the chips, see video in b/402083504

Change-Id: I65e74c472ccd6adcb2c74659a1ceb8ee207d84fd
parent d8593110
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment