I want to make a dialog box with full screen but not hiding the status bar.
If use style Theme_Light_NoTitleBar_Fullscreen
, the dialog box occupies the whole screen.
If use style Theme_Material_Light_NoActionBar_TranslucentDecor
, it seems working but the top of the dialog box actually is becoming transparent. I can make it better by enquiring the status bar height and add top padding to my dialog layout. This solution seems works fine, except it does not work if I attached an animation to it.
I am very confused why Google make the dialog box so complicated to use, and if I am doing correctly to make a full screen dialog box here?
Just use THEME_BLACK_NoTitleBar Worked For me!!!
You can use
android.R.style.Theme_Black_NoTitleBar_Fullscreen
AlertDialog.Builder builder = new AlertDialog.Builder(Objects.requireNonNull(getActivity()),
android.R.style.Theme_Black_NoTitleBar_Fullscreen);
This will use the primaryDarkColor for the status bar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With