Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Translucent Dialog Box in Android

enter image description here

Hi, I wish to achieve this look for my alert dialog but is unsure of how should i do it. I do know how to get the transparent alert dialog look in android but I can't find any clue for it to be translucent. Please leave some opinion or guide on how should I start doing it. Thanks so much!

Update: Sorry I have forgotten to include that actually I am using xml with the alert dialog theme instead of the normal alert dialog.

like image 723
Annabel Avatar asked Sep 02 '26 00:09

Annabel


1 Answers

To see the underlying activity un-dimmed:

dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);

To have the Dialog's background translucent, you have to set a background color with alpha < 255 (see the Color API).

like image 173
Bondax Avatar answered Sep 03 '26 15:09

Bondax