How to create a zoomable imageview in android ?

note that the 2 circles wont appear in a real device

In this tutorial i will walk you through integrating a zoom-in and zoom-out feature to your android's default imageview. For this we will be creating a custom imageview widget which will extend the characteristics of AppCompatImageView.
Using this method, you can perform the pinch gesture to zoom-in and zoom-out the image.

First of all create a custom imageview which extends AppCompatImageView like this following. By extending from this view, we are actually creating a new imageview which will have all the features of the AppCompatImageView along with the zoom-in and zoom-out feature that we are about to add.