app theme doesn't update after adding custom button style

Viewed 73

as mentioned in the title, after adding "@style/CustomRadioButton" to themes.xml nothing changes in the app (btw the CustomRadioButton style works when used in activityMain "style="@style/CustomRadioButton"")

themes.xml

    <style name="Theme.Covid19" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
    <!-- Primary brand color. -->
    <item name="colorPrimary">@color/purple_500</item>
    <item name="colorPrimaryVariant">@color/purple_700</item>
    <item name="colorOnPrimary">@color/white</item>
    <!-- Secondary brand color. -->
    <item name="colorSecondary">@color/teal_200</item>
    <item name="colorSecondaryVariant">@color/teal_700</item>
    <item name="colorOnSecondary">@color/black</item>
    <!-- Status bar color. -->
    <item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
    <!-- Customize your theme here. -->
    <item name="android:radioButtonStyle">@style/CustomRadioButton</item>
</style>

<style name="CustomRadioButton" parent="Widget.AppCompat.CompoundButton.RadioButton">
    <item name="android:background">@drawable/button_background</item>
    <item name="android:button">@null</item>
    <item name="android:textStyle">bold</item>
    <item name="android:textColor">@color/color_button_text</item>
</style>

androidManifest.xml

android:theme="@style/Theme.Covid19">
1 Answers

You are using a MaterialComponents theme so according to the guide on theming radio buttons you should leave out the android: namespace prefix:

<style name="Theme.Covid19" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
    ...
    <item name="radioButtonStyle">@style/CustomRadioButton</item>
</style>
Related