Created
January 21, 2019 19:03
-
-
Save haxzie-xx/83688c4b8f23307ec5b2f4f005be9657 to your computer and use it in GitHub Desktop.
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
| 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