Awesome Open Source
Awesome Open Source


Zoomy is an easy to use pinch-to-zoom Android library

alt tag


Zoomy is available in the JCenter, so you just need to add it as a dependency

compile 'com.ablanco.zoomy:zoomy:{latest version}'

where {latest version} corresponds to published version in JCenter Download


To start using Zoomy, just register the View you want to be zoomable

Zoomy.Builder builder = new Zoomy.Builder(this).target(mZoomableView);

Thats all. Now your views can be pinch-zoomed!

Views can be unregistered for Zoomy too



Zoomy allows a few customizations in its behavior:

  • Use ZoomyConfig to change default configuration flags
ZoomyConfig config = new ZoomyConfig();
config.setZoomAnimationEnabled(false); //Enables zoom out animation when view is released (true by default)
config.setImmersiveModeEnabled(false); //Enables entering in inmersive mode when zooming a view (true by default)          
  • Now set this as the default configuration across all Zoomy registered views

Zoomy builder also allows some customization

  • Zoomy config flags can also be set when building Zoomy registration. This flags will always override default ZoomyConfig flags.
    Zoomy.Builder builder = new Zoomy.Builder(this)
  • You can add callbacks to listen for specific events. Because Zoomy works by attaching a View.OnTouchListener to the registered View, View.OnClickListener can not be set along with Zoomy, so a TapListener, LongPressListener and DoubleTapListener are provided to ensure the View still can listen for gestures. A ZoomListener is also provided if you are interested in zoom events.
 Zoomy.Builder builder = new Zoomy.Builder(this)
                    .tapListener(new TapListener() {
                        public void onTap(View v) {
                            //View tapped, do stuff
                     .longPressListener(new LongPressListener() {
                        public void onLongPress(View v) {
                            //View long pressed, do stuff
                    }).doubleTapListener(new DoubleTapListener() {
                        public void onDoubleTap(View v) {
                            //View double tapped, do stuff
                    .zoomListener(new ZoomListener() {
                        public void onViewStartedZooming(View view) {
                            //View started zooming

                        public void onViewEndedZooming(View view) {
                            //View ended zooming
  • It is possible to change the interpolator used when animating ending zoom event.
   Zoomy.Builder builder = new Zoomy.Builder(this)
                    .interpolator(new OvershootInterpolator());


Copyright 2017 Álvaro Blanco Cabrero
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
java (31,711
android (6,455
android-library (812
zoom (75
pinch-to-zoom (20