cancel

open fun cancel()

This function can be called from a few different use cases, including Swiping the dialog down or calling `dismiss()` from a `BottomSheetDialogFragment`, tapping outside a dialog, etc...

The default animation to dismiss this dialog is a fade-out transition through a windowAnimation. Call setDismissWithAnimation if you want to utilize the BottomSheet animation instead.

If this function is called from a swipe down interaction, or dismissWithAnimation is false, then keep the default behavior.

Else, since this is a terminal event which will finish this dialog, we override the attached BottomSheetBehavior.BottomSheetCallback to call this function, after STATE_HIDDEN is set. This will enforce the swipe down animation before canceling this dialog.