public final boolean onSingleTapConfirmed(MotionEvent e) {
ImageView imageView = getImageView();
if (null != imageView) {
if (null != mPhotoTapListener) {
final RectF displayRect = 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();
mPhotoTapListener.onPhotoTap(imageView, xResult, yResult);
return true;
}
}
}
if (null != mViewTapListener) {
mViewTapListener.onViewTap(imageView, e.getX(), e.getY());
}
}
return false;
}
PhotoViewAttacher.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:KTalk
作者:
评论列表
文章目录