Set Style to Dialog and make it Fullscreen..

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Set Style to Dialog and make it Fullscreen..

Postby bins1984 » Mon Apr 26, 2010 7:58 am

hi

here i am trying to create a dialog which is not have a Header and border which should full screen in the window.

this is style to make it full screen...
<resources>
<style name="SettingsDialogTheme">
<item name="android:windowFrame">@null</item>
<item name="android:windowIsFloating">false</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/white</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:windowContentOverlay">@android:color/transparent</item>
</style>
</resources>


We can set the style if u extent the Dialog class like this

super(context,R.style.SettingsDialogTheme);
User avatar
bins1984
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Feb 08, 2008 8:20 am
Location: India

Top

Cutamize the dialog window

Postby bins1984 » Mon Apr 26, 2010 8:02 am

hi all,

Customize the dialog window ..

If you override the Dialog widget we can change the look and feel of the Dialog window also

Sample code

Window W= getWindow();
W.setGravity(Gravity.CENTER| Gravity.FILL_HORIZONTAL| Gravity.FILL_VERTICAL);
W.setLayout(ViewGroup.LayoutParams.FILL_PARENT,ViewGroup.LayoutParams.FILL_PARENT);
W.requestFeature(Window.FEATURE_NO_TITLE);
W.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
W.requestWindowFeature(Window.FEATURE_NO_TITLE);

Thanks and Regards
bins
User avatar
bins1984
Experienced Developer
Experienced Developer
 
Posts: 67
Joined: Fri Feb 08, 2008 8:20 am
Location: India

Re: Set Style to Dialog and make it Fullscreen..

Postby ringu » Sun May 15, 2011 3:43 pm

thanks! this helped me a lot!
if still have another problem. when i set dialog.setCancelable() to false I still can "break up" the dialog pressing the search button. have you got any clue how i could solve that problem?
ringu
Freshman
Freshman
 
Posts: 4
Joined: Sun Jun 20, 2010 10:55 am

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 5 guests