imablanco / Zoomy

Zoomy is an easy to use pinch-to-zoom Android library
918 stars 120 forks source link
android android-library pinch-to-zoom zoom zoom-images zoomable-images

Maven Central

Zoomy

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

alt tag

Installation

implementation 'io.github.imablanco:zoomy:{latest version}'

Usage

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


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

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

Views can be unregistered for Zoomy too


Zoomy.unregister(mZoomableView');

Customization

Zoomy allows a few customizations in its behavior:

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)          

Zoomy builder also allows some customization

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

License

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

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.