Issue
I know that you can change the status bar color in Android's themes.xml file with the following line:
<item name="android:statusBarColor" tools:targetApi="l">@color/teal_200</item>
That being said, if I want to customize the color (ie. make it a hex value), how can I do this?
Solution
You can define your own custom colors in a colors.xml
file in your res/values directory.
In colors.xml
you can do something like the following with your preferred hex value:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="custom_color">#FF3A52B2</color>
</resources>
And in your themes.xml
file you can then reference that custom color as follows:
<item name="android:statusBarColor" tools:targetApi="l">@color/custom_color</item>
Answered By - Colin Marsch
Answer Checked By - Marilyn (JavaFixing Volunteer)