code: private View.OnTouchListener createCanceledOnTouchListener() {
          return new View.OnTouchListener() {
  
              @SuppressLint("ClickableViewAccessibility")
              @Override
              public boolean onTouch(final View v, final MotionEvent event) {
                  return isCanceledOnTouchOutside() && !isFullscreen() && onCanceledOnTouchOutside();
              }
  
          };
      }
docs: Creates and returns a listener, which allows to cancel the dialog, when touched outside the
  window.
  
  @return The listener, which has been created, as an instance of the type {@link
  View.OnTouchListener}