Skip to content Skip to sidebar Skip to footer

Change Theme.dialog To Look Like Theme.light.dialog In Android

There is no Theme.Light.Dialog to use with the rest of my project that is using Theme.Light. How can I change Theme.Dialog to look like a Theme.Light version of Dialog. I know that

Solution 1:

Looks like I got it working.

<colorname="black">#FF000000</color><colorname="whitegrey">#FFF2F2F2</color><stylename="dialog_light"parent="@android:style/Theme.Dialog"><itemname="@android:windowBackground">@color/whitegrey</item><itemname="@android:textColor">@color/black</item></style>

Solution 2:

Further to the above, to avoid making up colors, I did this:

<!-- Makes a "light" equivalent of Theme.Dialog --><stylename="dialog_light"parent="@android:style/Theme.Dialog"><itemname="@android:background">@android:color/background_light</item><itemname="@android:textColor">@android:color/primary_text_light</item></style>

Solution 3:

This is good, thanks! I just changed it a bit: when I run what you suggested, the entire screen is painted with the back color and the dialog does not look as it should (with the previous activity dimmed).

So instead of using

@android:windowBackground

just use

@android:background

Post a Comment for "Change Theme.dialog To Look Like Theme.light.dialog In Android"