Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: default AppTheme background colors

What are the default background colors for Activities in Android's AppTheme style?

I'm looking for the hex code, or something that I can reference. It should be one for the LIGHT theme and one for the DARK theme.

Or where can I look them up? I'm confused by all the files and can't find the place where they actually say the color.

Thanks for your help.

Update:

I found entries in the SDK in /data/values/colors.xml, which are referenced by

@android:color/background_holo_light
@android:color/background_holo_dark

But I cannot put them as background color of my Views: it is giving an error saying the values are not public. Is there a workaround?

like image 254
Terry Avatar asked Nov 07 '13 16:11

Terry


People also ask

What is the default background color in Android?

By default each activity in Android has a white background. To change the background color, first add a new color definition to the colors.

What is the default theme in Android Studio?

In Android Studio, there are three default themes available i.e. Intellij Light, Dracula, and High Contrast. To change default themes go to File and click on Settings. A new Settings dialog will appear, like this.


2 Answers

You can use your theme's default background color by referencing the attribute:

?android:colorBackground

like image 90
Jason Robinson Avatar answered Sep 21 '22 06:09

Jason Robinson


Check out this colors.xml file. If you do a Ctrl-F for "backround_holo_dark" you can find the hex code. All the other holo theme colors are there as well. Enjoy!

<drawable name="screen_background_holo_light">#fff3f3f3</drawable>
<drawable name="screen_background_holo_dark">#ff000000</drawable>
<color name="background_holo_dark">#ff000000</color>
<color name="background_holo_light">#fff3f3f3</color>
like image 43
MDrabic Avatar answered Sep 20 '22 06:09

MDrabic