franmontiel / FullScreenDialog

A DialogFragment that implements the Full-screen dialog pattern defined in the Material Design guidelines.
Apache License 2.0
113 stars 29 forks source link

Statusbar problem #4

Open carmas123 opened 7 years ago

carmas123 commented 7 years ago

Hi and thank you for your work. I try to use your library but I've a big problem when I show the dialog. I got this result:

image

please can you help me?

Z1ni commented 7 years ago

Same here. Can't use this otherwise nice lib with this bug.

franmontiel commented 7 years ago

You probably have android:fitsSystemWindows="true" in your activity layout. This value must be set to false. I will check if I can implement a different layout when this option is set to avoid the issue completely.

alejandroaap commented 7 years ago

I have the same issue. Will you implement a solution?

Rasive commented 7 years ago

Quick fix for anyone having this problem:

final float scale = getContext().getResources().getDisplayMetrics().density; final View outerParent = (View) container.getParent(); outerParent.setPadding(0, (int) (24 * scale + 0.5f), 0, 0);

if your statusbar is transparent add this too:

outerParent.setBackgroundColor(getResources().getColor(R.color.colorPrimary)); outerParent.findViewById(com.franmontiel.fullscreendialog.R.id.content).setBackgroundColor(getResources().getColor(R.color.white));

Add this in your fragment´s onCreateView