Fixed
Status Update
Comments
co...@google.com <co...@google.com>
sg...@google.com <sg...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 548b3ed561aba470caa2273e4cf7b8c734c08717
Author: Shalom Gibly <sgibly@google.com>
Date: Thu Jul 20 20:46:44 2023
Fix custom colors usage in Material3 Checkboxes
- Update the CheckboxColors constructor to take a color value for
disabledUncheckedBorderColor.
- Update the API docs to make it clearer that the `uncheckedColor` and
the `disabledUncheckedColor` only affects the border, while the inner
box will be transparent by default.
Fixes: 291943198
Bug: 280825883
Test: Added screenshot tests
Relnote: "Updates to the Checkbox and TriStateCheckbox colors. The
CheckboxDefaults.colors() `disabledUncheckedColor` now only affects the
border of the checkbox. Special cases that require you to set the
internal box color when disabled and unchecked will require a custom
constructed instance of a CheckboxColors with the desired color values."
Change-Id: I77d1777868ed6f869730610f0de5bd2caffff01a
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/CheckboxScreenshotTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Checkbox.kt
https://android-review.googlesource.com/2670358
Branch: androidx-main
commit 548b3ed561aba470caa2273e4cf7b8c734c08717
Author: Shalom Gibly <sgibly@google.com>
Date: Thu Jul 20 20:46:44 2023
Fix custom colors usage in Material3 Checkboxes
- Update the CheckboxColors constructor to take a color value for
disabledUncheckedBorderColor.
- Update the API docs to make it clearer that the `uncheckedColor` and
the `disabledUncheckedColor` only affects the border, while the inner
box will be transparent by default.
Fixes: 291943198
Bug: 280825883
Test: Added screenshot tests
Relnote: "Updates to the Checkbox and TriStateCheckbox colors. The
CheckboxDefaults.colors() `disabledUncheckedColor` now only affects the
border of the checkbox. Special cases that require you to set the
internal box color when disabled and unchecked will require a custom
constructed instance of a CheckboxColors with the desired color values."
Change-Id: I77d1777868ed6f869730610f0de5bd2caffff01a
M compose/material3/material3/api/current.txt
M compose/material3/material3/api/restricted_current.txt
M compose/material3/material3/src/androidAndroidTest/kotlin/androidx/compose/material3/CheckboxScreenshotTest.kt
M compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/Checkbox.kt
na...@google.com <na...@google.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3:1.2.0-alpha05
androidx.compose.material3:material3-android:1.2.0-alpha05
Description
Steps to Reproduce or Code Sample to Reproduce:
I pass the following colors to
androidx.compose.material3.TriStateCheckbox
:However the result is that in desabled unchecked state the checkbox has lighter primary color instead of the expected lighter outline color (screenshot attached: most right checkbox is disabled unckecked state, second from the right is enabled unchecked).
CheckboxDefaults.colors()
doc says:However in internal
fun borderColor()
for disabled uncheck StatedisabledBorderColor
is used instead which leads to incorrect design: