Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit a58f2fa09ff63eb40a3d4c849883f540c03d2542
Author: John Nichol <jnichol@google.com>
Date: Wed May 11 12:42:49 2022
Chip/CompactChip/ToggleChip/SplitToggleChip remove fillMaxWidth
The Wear compose chip family is setting fillMaxWidth as the default behaviour. Given a chip is a slot based container this doesn't seem like
a good default and while there are workarounds available it makes sense
to take this chance to clean up the behaviour.
Bug: 232206371
Test: ./gradlew :wear:compose:compose-material:connectedCheck --info --daemon
RelNote: "We have changed the UX behaviour of Chip/ToggleChip/CompactChip/SplitToggleChip to stop them from doing fillMaxWidth by default. Instead they will grow to fit their contents. To keep the current behaviour simply add modifier = Modifier.fillMaxWidth()"
Change-Id: I60a2cc1d2a7c1d88483ecbb374beae7fe4a688ff
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Chip.kt
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ToggleChip.kt
M wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ToggleChipTest.kt
https://android-review.googlesource.com/2095206
Branch: androidx-main
commit a58f2fa09ff63eb40a3d4c849883f540c03d2542
Author: John Nichol <jnichol@google.com>
Date: Wed May 11 12:42:49 2022
Chip/CompactChip/ToggleChip/SplitToggleChip remove fillMaxWidth
The Wear compose chip family is setting fillMaxWidth as the default behaviour. Given a chip is a slot based container this doesn't seem like
a good default and while there are workarounds available it makes sense
to take this chance to clean up the behaviour.
Bug: 232206371
Test: ./gradlew :wear:compose:compose-material:connectedCheck --info --daemon
RelNote: "We have changed the UX behaviour of Chip/ToggleChip/CompactChip/SplitToggleChip to stop them from doing fillMaxWidth by default. Instead they will grow to fit their contents. To keep the current behaviour simply add modifier = Modifier.fillMaxWidth()"
Change-Id: I60a2cc1d2a7c1d88483ecbb374beae7fe4a688ff
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/Chip.kt
M wear/compose/compose-material/src/commonMain/kotlin/androidx/wear/compose/material/ToggleChip.kt
M wear/compose/compose-material/src/androidAndroidTest/kotlin/androidx/wear/compose/material/ToggleChipTest.kt
Description
Component used: Chip/ToggleChip/SplitToggleChip Version used: alpha21
The Chip family (Chip/CompactChip/ToggleChip/SplitToggleChip) are all defaulting to fillMaxWidth and as a result will not swap contents by default. Given a chip is a container it is probably more natural to have it's size fit the contents by default and allow developers to set .width()/.fillMaxWidth() as they need.