Is there a built in API for handling pinch-zoom functionality in Android

krise picture krise · Apr 15, 2010 · Viewed 10.7k times · Source

I just wanted to know if there is some kind of class to use the multitouch features of android 2.1. Specifically I am trying to implement pinch-zoom and was wondering if I always have to measure the distance between two touch events and calculate the zoom level on my own?

Thanks, chris

Answer

Mirko N. picture Mirko N. · Apr 30, 2010

I'm trying to do the same thing, and as usual my first instinct was to look into the Android source code itself. The interesting bits seem to be in class ScaleGestureDetector, which is not public but its javadoc says

@hide Pending API approval

so hopefully it will become public at some point.

Update: ScaleGestureDetector is now part of the Android 2.2 API.