Skip to content

Instantly share code, notes, and snippets.

@haxzie-xx
Created January 21, 2019 19:03
Show Gist options
  • Select an option

  • Save haxzie-xx/83688c4b8f23307ec5b2f4f005be9657 to your computer and use it in GitHub Desktop.

Select an option

Save haxzie-xx/83688c4b8f23307ec5b2f4f005be9657 to your computer and use it in GitHub Desktop.
public class FullScreenDialog extends DialogFragment {
public static String TAG = "FullScreenDialog";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setStyle(DialogFragment.STYLE_NORMAL, R.style.FullScreenDialogStyle);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View view = inflater.inflate(R.layout.layout_full_screen_dialog, container, false);
Toolbar toolbar = view.findViewById(R.id.toolbar);
toolbar.setNavigationIcon(R.drawable.ic_close_white_24dp);
toolbar.setNavigationOnClickListener(view1 -> cancelUpload());
toolbar.setTitle("Uploading");
return view;
}
@Override
public void onStart() {
super.onStart();
Dialog dialog = getDialog();
if (dialog != null) {
int width = ViewGroup.LayoutParams.MATCH_PARENT;
int height = ViewGroup.LayoutParams.MATCH_PARENT;
dialog.getWindow().setLayout(width, height);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment