Skip to content

Instantly share code, notes, and snippets.

@furkanaskin
Created April 20, 2020 02:06
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 furkanaskin/c48c4740953d5a3b4a5dfcac8d9a99b8 to your computer and use it in GitHub Desktop.
Save furkanaskin/c48c4740953d5a3b4a5dfcac8d9a99b8 to your computer and use it in GitHub Desktop.
class BottomSheetSampleFragment : BaseBottomSheetFragment() {
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = super.onCreateDialog(savedInstanceState) as BottomSheetDialog
dialog.setOnShowListener {
val bottomSheet =
(it as BottomSheetDialog).findViewById<View>(com.google.android.material.R.id.design_bottom_sheet) as FrameLayout?
val behavior = BottomSheetBehavior.from(bottomSheet!!)
behavior.state = BottomSheetBehavior.STATE_EXPANDED
behavior.isDraggable = false
}
return dialog
}
// Other stuffs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment