Hi,
I’m using RubberBandXyZoomModifier for zooming and i want to reverse the process.
If i double tap to screen, i want the process to be reversed and back to last zooming level.
Firstly how can I dedect the double tap, and secondly how can I reverse the process?
Tnx.
- Dunya Biralem asked 5 years ago
- You must login to post comments
Hi Dunya,
Unfortunately we don’t support such behavior out of the box, because usually chart contains more than one modifier which modifies VisibleRange of axis (e.g. scroll, pinch zoom, rubber band zoom etc ) so this would require more complex solution to track these changes, because VisibleRange can be changes also by animations, by axis itself during auto range process etc.
If you case is pretty simple you can just set VisibleRangeChangeListener for axis and record all changes when onVisibleRangeChanged() is called and then when it’s needed set VisibleRange values from saved history.
As for double tap – you can achieve this by creating custom chart modifier:
class CustomModifier extends GestureModifierBase {
@Override
public boolean onDoubleTap(MotionEvent e) {
// do something
return true;
}
}
Hope this will help you!
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
Thanks for the advice.
And secondly how can i block the full zoom out when i double tap.
Tnx.
- Dunya Biralem answered 5 years ago
- last edited 5 years ago
-
Hi Dunya, zoom to fit on double-tap is provided by the ZoomExtentsModifier, so if you don’t want that behaviour, simply don’t include it in your chart. Best regards, Andrew
-
Thank you Andrew.
- You must login to post comments
Please login first to submit.