Skip to content

Instantly share code, notes, and snippets.

@mhrpatel12
Last active August 31, 2019 17:53
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 mhrpatel12/d990a8cf06bcbf7cec983accea7ba6e3 to your computer and use it in GitHub Desktop.
Save mhrpatel12/d990a8cf06bcbf7cec983accea7ba6e3 to your computer and use it in GitHub Desktop.
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val bottomSheetDialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
bottomSheetDialog.setOnShowListener {
val dialog = it as BottomSheetDialog
val bottomSheet = dialog.findViewById<View>(com.google.android.material.R.id.design_bottom_sheet)
BottomSheetBehavior.from(bottomSheet).state = BottomSheetBehavior.STATE_EXPANDED
}
return bottomSheetDialog
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment