Changing default Android fade/scrim color when calling a Dialog -
i've been working on app , i've reaching point requires me display menu window in middle of screen.
i've been using alertdialog object filled custom view required of me "surround" window semi-transparent white glow opposed default grayish one. did similar fade-in color of navigation drawers have on app in case had specific method me solve problem. far haven't found helps me solve one.
i tried creating default style new "windowbackground" value encountered 3 problems get-go:
- i'm no longer able shut alertdialog down clicking outside layout (i'm guessing because changing color way layout)
- the menu window surrounded black outline wasn't there before
- by using filtering search inside layout, manipulates members of list, window collapses on itself
is there way accomplish want more or less directly?
i'm not sure it, can use in styles.xml
<style name="mydialogtheme" parent="android:theme.appcompat.light.dialog"> <item name="android:windowframe">@null</item> <item name="android:windowisfloating">true</item> <item name="android:windownotitle">true</item> <item name="android:windowbackground">@color/your_light_color</item> <item name="android:backgrounddimenabled">false</item> and if want dismiss dialog when clicking outside, use this:
dialog.setcanceledontouchoutside(true); or
<item name="windowcloseontouchoutside">true</item> in styles.xml
Comments
Post a Comment