- Posts: 19
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Double tap zoom show view where finger click
- [email protected]
- Topic Author
- Offline
- New Member
-
Less
More
11 years 2 months ago #9127
by [email protected]
Double tap zoom show view where finger click was created by [email protected]
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 :
below is my code :
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;
}
- [email protected]
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 19
- Thank you received: 0
11 years 2 months ago #9134
by [email protected]
Replied by [email protected] on topic Double tap zoom show view where finger click
Anyone can help me on this?
11 years 2 months ago #9163
by dashti
Replied by dashti on topic Double tap zoom show view where finger click
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.
Time to create page: 0.403 seconds