After the latest Android Studio update, styles.xml is now replaced with two themes.xml files, one for day and one for night, to match the Dark Mode introduced in Android 10.
Before that I was able to set the color of status bar to match the app background by adding this line to AppTheme in styles.xml file:
<item name="android:statusBarColor">?android:attr/windowBackground</item>
It worked perfectly back then.
Now I can't apply that line with the new themes.xml :
<style name="Theme.DietCorner" 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. -->
</style>
Another issue with this update, there is no way I can change any button background color unless I use color tint, otherwise the button takes the colorPrimaryVariant color.
Any solution for these issues, is appreciated. And if there is any tutorial about how to handle the new themes.xml files, I would like to read them. Thanks in advance.