Created
February 2, 2015 09:43
-
-
Save mustafasevgi/c67548e0512c4dde748b to your computer and use it in GitHub Desktop.
Full screen dialog fragment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public Dialog onCreateDialog(final Bundle savedInstanceState) { | |
// the content | |
final RelativeLayout root = new RelativeLayout(getActivity()); | |
root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); | |
// creating the fullscreen dialog | |
final Dialog dialog = new Dialog(getActivity()); | |
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); | |
dialog.setContentView(root); | |
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.WHITE)); | |
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); | |
return dialog; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment