android-pdfview
android-pdfview copied to clipboard
Double tap to zoom
Is it possible to double tap to zoom? The only thing it does is double tap to reset zoom.
Would be nice indeed, PR is welcome!
@JoanZapata and @tippl hey guys i found a way to zoom on double tap
@JoanZapata first of all thanks for this wonderful library for pdfs , i have used it with a vertical view pager for my app with some modifications to this library and it works as smooth as butter ;P
Ok for having Double tap zoom we have to add some extra code to 2 classes ( PDFView, DragPinchManager ) here is the code below ..
1st - PDFView.java
add this in constructor -
paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true);
next Add this new method
public void doubleTapZoomWithAnimation()
{
animationManager.startZoomAnimation(zoom, 3.5f);
}
2nd- DragPinchManager.java
change the onDoubleTap method to the below code
@Override
public void onDoubleTap(float x, float y) {
if (isZooming()) {
//TODO reset
pdfView.resetZoomWithAnimation();
}else{
//TODO zoom
pdfView.doubleTapZoomWithAnimation();
}
}
And the now the Double tap is good to go ;)
Cheers , Vinay Sasalatti
@vinaysasalatti-android thanks for your answer . but only zoom and no center with double click position