I have a very simple registration form that appears when I click a button to register. This form appears in DialogFragment
, however, with a very small size.
Zonzando on the internet I found a code that changes the size of it:
@Override
public void onStart() {
super.onStart();
if (getDialog() == null)
return;
int dialogWidth = 200;
int dialogHeight = 400;
getDialog().getWindow().setLayout(dialogWidth, dialogHeight);
}
But it seems that it defines these values in pixels, so I wanted to know if there is a way to calculate the width of the screen (or view I do not know) and set the width to 80% of the screen and let the height increase automatically.
Note: I'm a little confused by my words but I can understand my purpose with this question, if you do not understand, just make a comment that I explain in more detail.