Android's ImageView pinch-to-zoom made easy
Add this line to your build.gradle's dependencies:
PinchToZoom for Android is a simple yet feature complete library for adding pinch-to-zoom functionality to an ImageView. It has sleek easing animations that make it stand out in quality and ease of use.
Adding pinch-to-zoom functionality to your ImageView is easy as this:
ImageView imageView = (ImageView) view.findViewById(R.id.image); imageView.setOnTouchListener(new ImageMatrixTouchHandler(view.getContext()));
The ImageMatrixTouchHandler class has multiple getter/setter methods that allow for changing the behavior and animation settings.
Consult the Javadoc at https://martinwithaar.github.io/PinchToZoom/