Skip to content

Instantly share code, notes, and snippets.

@fanjavaid
Created September 4, 2017 09:50
Show Gist options
  • Select an option

  • Save fanjavaid/f5cf2b548549753c874a18ed9ac0c74a to your computer and use it in GitHub Desktop.

Select an option

Save fanjavaid/f5cf2b548549753c874a18ed9ac0c74a to your computer and use it in GitHub Desktop.
Set width and height in DialogFragment
...
@Override
public void onResume() {
ViewGroup.LayoutParams params = getDialog().getWindow().getAttributes();
params.width = LayoutParams.MATCH_PARENT;
params.height = LayoutParams.MATCH_PARENT;
getDialog().getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);
super.onResume();
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment