GetOnPhotoTapListener() public method

public GetOnPhotoTapListener ( ) : IOnPhotoTapListener
return IOnPhotoTapListener
Ejemplo n.º 1
0
        public bool OnSingleTapConfirmed(Android.Views.MotionEvent e)
        {
            if (this.photoViewAttacher == null)
            {
                return(false);
            }
            ImageView imageView = photoViewAttacher.GetImageView();

            if (null != photoViewAttacher.GetOnPhotoTapListener())
            {
                RectF displayRect = photoViewAttacher.GetDisplayRect();
                if (null != displayRect)
                {
                    float x = e.GetX(), y = e.GetY();

                    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);
        }
Ejemplo n.º 2
0
 public PhotoViewDroidAttacher.IOnPhotoTapListener GetOnPhotoTapListener()
 {
     return(mAttacher.GetOnPhotoTapListener());
 }