Skip to content

Instantly share code, notes, and snippets.

@k0siara
Created March 29, 2023 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k0siara/114306b4bb99d9aef90e7a9afe62b183 to your computer and use it in GitHub Desktop.
Save k0siara/114306b4bb99d9aef90e7a9afe62b183 to your computer and use it in GitHub Desktop.
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