DialogFragment fullscreen shows padding on sides

https://groups.google.com/forum/#!topic/android-developers/NDFo9pF8sHY

From Dianne Hackborn suggestion

Use non-dialog theme as android.R.style.Theme or android.R.style.Theme_Light.

Look @ the themes

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml.

Check this link

http://developer.android.com/reference/android/app/DialogFragment.html

DialogFragment picker = MyDialogFragment.newInstance();
picker.setStyle( DialogFragment.STYLE_NORMAL, android.R.style.Theme );
picker.show(getFragmentManager(), "MyDialogFragment");

if you set this theme to your dialog it will always be fullscreen

<!-- DIALOG STYLE -->
<style name="You.Dialog" parent="android:Theme.Holo.Dialog" >
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowIsFloating">false</item>
</style>

to do so you can use this setStyle(int,int) method.

dialogFragment.setStyle( DialogFragment.STYLE_NORMAL, R.style.You_Dialog );

I figured it out using custom dialog theme. windowIsFloating true will get rid of the background but will add some extra space underneath the background as a background. In which case you can use windowBackground @null to erase it.

<style name="CustomDialog" parent="@android:style/Theme.Holo.Light" >
    <item name="android:windowBackground">@null</item>
    <item name="android:windowIsFloating">true</item>
</style>

Usage:

AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CustomDialog);

Thank you to Raghunandan who gave me the link that includes all style attributes. It took me a while but I went through that file and found very interesting elements. Definitely have a look at the link posted below to explore theme styles.

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml