Skip to content

[MaterialCheckBox] Unchecked outline color does not match M3 specs when pressed, focused, hovered #4786

Open
@BloCamLimb

Description

@BloCamLimb

Description: According to the M3 specs, the outline color should be colorOnSurfaceVariant when unchecked, and colorOnSurface when pressed, focused, or hovered. Currently MDC always uses colorOnSurfaceVariant.

This bug exists in both MaterialCheckBox and MaterialRadioButton, they will use the same coloring.

Expected behavior: Use colorOnSurface when unchecked && (pressed || focused || hovered).

Source code:
In CheckBox, MDC has only unchecked state color, and the colors in the other three states are missing.

<!-- Unchecked -->
<item android:color="@macro/m3_comp_checkbox_unselected_outline_color" android:state_checked="false"/>

In RadioButton, the other three colors are defined, but should be declared as android:state_checked="false" instead of true.

<!-- Unchecked -->
<item android:color="@macro/m3_comp_radio_button_unselected_pressed_icon_color"
android:state_pressed="true" android:state_checked="true"/>
<item android:color="@macro/m3_comp_radio_button_unselected_focus_icon_color"
android:state_focused="true" android:state_checked="true"/>
<item android:color="@macro/m3_comp_radio_button_unselected_hover_icon_color"
android:state_hovered="true" android:state_checked="true"/>
<item android:color="@macro/m3_comp_radio_button_unselected_icon_color"
android:state_checked="false"/>

Material Library version: 1.13.0-alpha13

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions