Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about Android development and PDF
  • Page:
  • 1

TOPIC:

Double tap zoom show view where finger click 8 years 9 months ago #9127

  • abhilash_vijayakumar@yahoo.com
  • abhilash_vijayakumar@yahoo.com's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0
I had customized to PDFLayoutView to have double tap to zoom. It is working but the pdf always move to the top left corner after zoom. how to zoom and show the pdf according to where the pdf user double tap?

below is my code :
// event when double tap occurs
        @Override
        public boolean onDoubleTap(MotionEvent e) {
            float x = e.getX();
            float y = e.getY();

            if (m_layout.vGetScale() <= 1.0){
                int vx = (int) x;
                int vy = (int) y;
                PDFLayout.PDFPos pos = m_layout.vGetPos(vx, vy);
                m_layout.vZoomSet(vx, vy, pos, 3.0f);
            } else {
                int vx = (int) x;
                int vy = (int) y;
                PDFLayout.PDFPos pos = m_layout.vGetPos(vx, vy);
                m_layout.vZoomSet(vx, vy, pos, 1.0f);
            }
            return true;
        }

Please Log in or Create an account to join the conversation.

Double tap zoom show view where finger click 8 years 9 months ago #9134

  • abhilash_vijayakumar@yahoo.com
  • abhilash_vijayakumar@yahoo.com's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 19
  • Thank you received: 0
Anyone can help me on this?

Please Log in or Create an account to join the conversation.

Double tap zoom show view where finger click 8 years 9 months ago #9163

  • dashti
  • dashti's Avatar
  • Offline
  • New Member
  • New Member
  • Posts: 10
  • Thank you received: 0
As I checked in my own project, calling vZoomSet causes the reader jump to the corner of another page. The solution was to mimic smooth zoom action and call vZoomStart, vZoomSet and vZoomConfirmed with some delay. It seems the new LayoutView interface is so buggy with use of zoom action. Also in RDPDFReader demo, if you zoom in and try move the layout with your finger for some time, it jumps to the first page suddenly.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum