Coder Social home page Coder Social logo

Double tap to zoom about android-pdfview HOT 3 OPEN

joanzapata avatar joanzapata commented on June 2, 2024
Double tap to zoom

from android-pdfview.

Comments (3)

JoanZapata avatar JoanZapata commented on June 2, 2024

Would be nice indeed, PR is welcome!

from android-pdfview.

vinaysasalatti-android avatar vinaysasalatti-android commented on June 2, 2024

@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

from android-pdfview.

SuperXFan avatar SuperXFan commented on June 2, 2024

@vinaysasalatti-android thanks for your answer . but only zoom and no center with double click position

from android-pdfview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.