Updated Answer
Code can be found here : official-doc
Answer Outdated
Check out the following links which may help you
Best examples are provided in the below links, which you can refactor to meet your requirements.
-
Implementing the pinch zoom gesture
-
Android-pinch
-
GestureDetector.SimpleOnGestureListener