I'm using dark and light mode in my Android application. I made an attrs.xml file in the values folder. and I adjusted attr values . And I created 2 styles in styles.xml for night and light mode. so it works on Android above 21 but doesn't work below 21. How do I fix it ????
attrs.xml
<declare-styleable name="ds">
<attr name="backact" format="color"/>
<attr name="toolbar_backact" format="color"/>
<attr name="textcolor" format="color"/>
</declare-styleable>
styles.xml
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="backact">@color/backact</item>
<item name="toolbar_backact">@color/toolbar_backact</item>
<item name="textcolor">@color/textcolor</item>
</style>
<style name="DarkTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="backact">#0a131c</item>
<item name="toolbar_backact">#19242e</item>
<item name="textcolor">#FDFDFD</item>
</style>