I used a custom layout with a ScaleGestureDectector
class to zoom in, zoom out my custom view. My problem is when I zoom in at 3.0x and above, my custom layout cannot be zoomed out, and difficult to zoom in (too lag)
Here is my code :
private class ScaleGestureListener
extends ScaleGestureDetector.SimpleOnScaleGestureListener {
@Override
public boolean onScale(ScaleGestureDetector detector) {
float scaleFactor = mScaleFactor * detector.getScaleFactor();
mScaleFactor = scaleFactor;
setScaleX(getScaleX() * mScaleFactor);
setScaleY(getScaleY() * mScaleFactor);
invalidate();
return true;
}
Have a solution for this problem?