Search code examples
androidfullscreenandroid-dialogfragment

Android: How to have dialogFragment to fullscreen


Hello I have tried to override the theme to the dialogFragment for fullscreen but the full screen I wanted was an overlay on top of the previous activity so when the dialogFragment is opened, we still can see back activity from the padding between the screen and the dialogFragment.

This is the style I have used for full screen

<style name="fullscreen_dialog" parent="android:Theme" >
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowIsFloating">false</item>
</style>

Solution

  • You could just manually set the layout params in code like so. Hope it helps ! :). Also check it this SO Adjusting size of custom dialog box in android

    Window window = myDialog.getWindow();
    window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);