Created
March 29, 2023 07:14
-
-
Save k0siara/114306b4bb99d9aef90e7a9afe62b183 to your computer and use it in GitHub Desktop.
This file contains 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
class DialogExample : DialogFragment() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
// Custom style | |
setStyle(STYLE_NORMAL, R.style.FullScreenDialog_Light) | |
} | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View { | |
return dialogFragmentComposeView { | |
DialogContent() | |
} | |
} | |
override fun onStart() { | |
super.onStart() | |
// Full screen dialog | |
dialog?.window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment