1

I use a Modal Bottom Sheet to allow the user to enter some text and create Decisions or Tasks.

KEYBOARD SHOWN

KEYBOARD HIDDEN

Some users want to close the keyboard and they tap outside of the Bottom Sheet and close it. This is a big issue because all the text is lost.

The material design documentation states that it can be dismissed when the outside is touched but this doesn't work for me.

I want to intercept the onOutsideClick event and check the keyboard's state:

  • Keyboard shown: Close the soft keyboard
  • Keyboard hidden: Dismiss the Bottom Sheet

Should I use a custom BottomSheetBehavior or can I Override some dialog methods?

Vlad
  • 988
  • 12
  • 18
  • See https://stackoverflow.com/questions/42154321/prevent-dismissal-of-bottomsheetdialogfragment-on-touch-outside. – CoolMind Apr 16 '19 at 16:14

0 Answers0