0

Hello I am new to Android. How can I build a dark theme in Android where all background is black and primary text and input color is deep orange instead of white?

This is the current style for my app:

 <style name="AppTheme" parent="Theme.AppCompat">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

The theme is dark with these settings but I am unable to set the primary text color to deep orange. What do I need to add in this style so that all my white text and inputs have orange color?

This is what kind of theme I need for my app: Image of an Android phone with the theme I need

plr108
  • 1,201
  • 11
  • 16
sam999
  • 115
  • 1
  • 13

1 Answers1

0

Create a another style.xml for api 21 using reference this and write the below code in your new style.xml

<style name="MaterialStyle" parent="AppTheme.base">
        <item name="android:windowBackground">@color/YOUR_COLOR</item>
</style>

And also change your old styles.xml with below code,

<style name="MaterialStyle" parent="AppTheme.base"/>

<style name="AppTheme.base" parent="Theme.AppCompat">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

and also update in manifest.xml

android:theme="@style/MaterialStyle"
Nikhil Sawant
  • 103
  • 10