Closed
Description
Is your feature request related to a problem? Please describe.
MaterialRadioButton inherits the text color from Widget.CompoundButton
, which sets it to an arcane attribute - ?android:attr/textColorPrimaryDisableOnly
.
We can set this attribute in our theme or we can set android:textColor
in the layout/our default style/style.
Describe the solution you'd like
Override android:textColor
in Widget.MaterialComponents.CompoundButton.RadioButton
:
<style name="Widget.MaterialComponents.CompoundButton.RadioButton" parent="Widget.AppCompat.CompoundButton.RadioButton">
<item name="android:textColor">?attr/colorOnSurface</item>
</style>
Describe alternatives you've considered
For now, I've explicitly set a default style for the AppCompat/Material RadioButton:
<style name="Base.Theme.Monzo" parent="Platform.Theme.Monzo">
<item name="radioButtonStyle">@style/Widget.Monzo.CompoundButton.RadioButton</item>
...
<style name="Widget.Monzo.CompoundButton.RadioButton"
parent="Widget.MaterialComponents.CompoundButton.RadioButton">
<item name="android:textColor">?android:attr/textColorPrimary</item>
</style>
Similar for checkbox and switch!