turbandroid
turbandroid

Reputation: 2306

Default background color of Theme.AppCompat.Light android

What is the color code (hex) Android System use if windowBackground set to null as follows for parent theme Theme.AppCompat.Light

<item name="android:windowBackground">@null</item>

Can anyone help me to know the exact hexa code?

Upvotes: 6

Views: 7210

Answers (3)

ישו אוהב אותך
ישו אוהב אותך

Reputation: 29783

@null means no background at all (View.getBackground() returns null).
It means you want to remove the background.

These are related QA:
is there any diff @null Vs #00000000
Set Background as null
How to have a transparent ImageButton: Android
How can I specify a null as an XML attribute for Android?

Upvotes: 1

Marcin Koziński
Marcin Koziński

Reputation: 11044

If you set android:windowBackground to null then you're not going to get default colour from parent theme. You're actually overriding this to be null, which means nothing's going to be painted as your window background. If your layouts don't cover the window completely with their own backgrounds then you're going to see random artifacts.

In other words Avoid Null Window Backgrounds.

Upvotes: 3

Sakchham
Sakchham

Reputation: 1739

It uses

<color name="material_grey_50">#fffafafa</color>

as described in the theme Platform.AppCompat.Light. This value is for appcompat-v7:23.4.0 and might differ on other versions.

Upvotes: 9

Related Questions