I am using Theme.MaterialComponents.DayNight.NoActionBar
as the app theme, and I am having weird issues when it comes to buttons colours and there are some spacing issues I am facing.
I have read that adding <item name="viewInflaterClass">androidx.appcompat.app.AppCompatViewInflater</item>
should fix it and it does but I want to know if there is any other way to change it to work like it used to as there can be issues with this approach.
It is not just effecting date picker buttons but also DialogFragments
DatePickerDialog has blacked out buttons in androidx.fragment.app.DialogFragment
ColorPrimary is set to the button itself. Is there any other way I can overwrite this behaviour
Here is my style
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar.FullScreen">
<item name="colorPrimary">@color/colorPrimary</item> // Blue
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorControlNormal">@color/colorControlNormal</item>
<item name="colorControlActivated">@color/colorControlActivated</item>
<item name="colorSwitchThumbNormal">@color/colorSwitchThumbNormal</item>
<item name="android:textColorPrimary">@android:color/primary_text_light</item>
<item name="android:textColorSecondary">@android:color/secondary_text_light</item>
<item name="android:textColorPrimaryInverse">@android:color/primary_text_dark</item>
<item name="android:windowBackground">@android:color/background_light</item>
<item name="dialogTheme">@style/DialogStyle</item>
<item name="alertDialogTheme">@style/AlertDialogStyle</item>
<item name="md_positive_color">@color/dialog_positive_text</item>
<item name="md_neutral_color">@color/dialog_neutral_text</item>
<item name="md_negative_color">@color/dialog_negative_text</item>
//Adding the bellow line fixes it
<item name="viewInflaterClass">androidx.appcompat.app.AppCompatViewInflater</item>
</style>
<style name="Theme.MaterialComponents.DayNight.NoActionBar.FullScreen" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowTranslucentNavigation">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
But looks like this with this theme