I'm trying to make the ScrollView zoom-able following this post
mScaleDetector = new ScaleGestureDetector(context,
new ScaleGestureDetector.SimpleOnScaleGestureListener() {
@Override
public boolean onScale(ScaleGestureDetector detector) {
float scale = 1 - detector.getScaleFactor();
float prevScale = mScale;
mScale += scale;
if (mScale < 0.1f) // Minimum scale condition:
mScale = 0.1f;
if (mScale > 10f) // Maximum scale condition:
mScale = 10f;
ScaleAnimation scaleAnimation = new ScaleAnimation(
1f / prevScale, 1f / mScale, 1f / prevScale,
1f / mScale, detector.getFocusX(),
detector.getFocusY());
scaleAnimation.setDuration(0);
scaleAnimation.setFillAfter(true);
startAnimation(scaleAnimation);
return true;
}
});
but the zooming scrolls only work up and down, i'm trying to make it scroll left and right too.