private View . OnTouchListener createCancelOnTouchListener ( ) { return new View . OnTouchListener ( ) { @ Override public boolean onTouch ( final View v , final MotionEvent event ) { if ( cancelable && canceledOnTouchOutside ) { cancel ( ) ; v . performClick ( ) ; return true ; } return false ; } } ; }
Creates and returns a listener which allows to cancel the bottom sheet when the decor view is touched .