How can I implement double tap to zoom in the https://github.com/facebook/fresco/tree/master/samples/zoomable project?
The pinch to zoom works fine, does anyone have a working example?
Here is the code for smooth double tap zoom and pinch to zoom for the fresco library
https://github.com/arlindiDev/FrescoDoubleTapZoom

Hi! I haven't checked what modifications you made to the samples code, but all you need to do is implement GestureDetector.SimpleOnGestureListener and set it as a setTapListener to your zoomable Drawee view.
private void setTapListener(final ZoomableDraweeView view) {
final AnimatedZoomableController zc = (AnimatedZoomableController) view.getZoomableController();
view.setTapListener(new GestureDetector.SimpleOnGestureListener() {
private final PointF mDoubleTapViewPoint = new PointF();
private final PointF mDoubleTapImagePoint = new PointF();
@Override
public boolean onDoubleTapEvent(MotionEvent e) {
PointF vp = new PointF(e.getX(), e.getY());
PointF ip = zc.mapViewToImage(vp);
switch (e.getAction()) {
case MotionEvent.ACTION_DOWN:
mDoubleTapViewPoint.set(vp);
mDoubleTapImagePoint.set(ip);
break;
case MotionEvent.ACTION_UP:
if (zc.getScaleFactor() < 1.5f) {
zc.zoomToPoint(2.0f, ip, vp, DefaultZoomableController.LIMIT_ALL, 300, null);
} else {
zc.zoomToPoint(1.0f, ip, vp, DefaultZoomableController.LIMIT_ALL, 300, null);
}
break;
}
return true;
}
});
}
Most helpful comment
Hi! I haven't checked what modifications you made to the samples code, but all you need to do is implement
GestureDetector.SimpleOnGestureListenerand set it as a setTapListener to your zoomable Drawee view.