@Override
  public boolean onSingleTapConfirmed(MotionEvent e) {
    if (this.photoViewAttacher == null) return false;

    ImageView imageView = photoViewAttacher.getImageView();

    if (null != photoViewAttacher.getOnPhotoTapListener()) {
      final RectF displayRect = photoViewAttacher.getDisplayRect();

      if (null != displayRect) {
        final float x = e.getX(), y = e.getY();

        // Check to see if the user tapped on the photo
        if (displayRect.contains(x, y)) {

          float xResult = (x - displayRect.left) / displayRect.width();
          float yResult = (y - displayRect.top) / displayRect.height();

          photoViewAttacher.getOnPhotoTapListener().onPhotoTap(imageView, xResult, yResult);
          return true;
        }
      }
    }
    if (null != photoViewAttacher.getOnViewTapListener()) {
      photoViewAttacher.getOnViewTapListener().onViewTap(imageView, e.getX(), e.getY());
    }

    return false;
  }
 @Override
 public RectF getDisplayRect() {
   return mAttacher.getDisplayRect();
 }