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 I must overwrite sections of Theme.Dialog
in styles.xml as below. What items should I overwrite with which values?
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="android:???????"></item>
<item name="android:???????"></item>
</style>
I could just make the background that light white grey, but the buttons, spinners etc are also different on the light theme to look better on the light background.
EDIT
Looks like I got it working.
<color name="black">#FF000000</color>
<color name="whitegrey">#FFF2F2F2</color>
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="@android:windowBackground">@color/whitegrey</item>
<item name="@android:textColor">@color/black</item>
</style>
Go to File > Settings, now under IDE settings click on appearance and select the theme of your choice from the dropdown. File > Import Settings , select the file or your choice and select ok a pop up to restart the studio will open up click yes and studio will restart and your theme will be applied.
There are three kinds of lists available with the AlertDialog APIs: A traditional single-choice list. A persistent single-choice list (radio buttons) A persistent multiple-choice list (checkboxes)
Alert Dialog shows the Alert message and gives the answer in the form of yes or no. Alert Dialog displays the message to warn you and then according to your response the next step is processed. Android Alert Dialog is built with the use of three fields: Title, Message area, Action Button.
Looks like I got it working.
<color name="black">#FF000000</color>
<color name="whitegrey">#FFF2F2F2</color>
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="@android:windowBackground">@color/whitegrey</item>
<item name="@android:textColor">@color/black</item>
</style>
Further to the above, to avoid making up colors, I did this:
<!-- Makes a "light" equivalent of Theme.Dialog -->
<style name="dialog_light" parent="@android:style/Theme.Dialog">
<item name="@android:background">@android:color/background_light</item>
<item name="@android:textColor">@android:color/primary_text_light</item>
</style>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With