https://github.com/imablanco/Zoomy
  
  
    Zoomy is an easy to use pinch-to-zoom Android library 
    https://github.com/imablanco/Zoomy
  
android android-library pinch-to-zoom zoom zoom-images zoomable-images
        Last synced: 7 months ago 
        JSON representation
    
Zoomy is an easy to use pinch-to-zoom Android library
- Host: GitHub
 - URL: https://github.com/imablanco/Zoomy
 - Owner: imablanco
 - Created: 2017-02-14T22:29:46.000Z (over 8 years ago)
 - Default Branch: master
 - Last Pushed: 2023-03-14T08:38:18.000Z (over 2 years ago)
 - Last Synced: 2024-10-13T08:54:09.682Z (about 1 year ago)
 - Topics: android, android-library, pinch-to-zoom, zoom, zoom-images, zoomable-images
 - Language: Java
 - Size: 16.6 MB
 - Stars: 918
 - Watchers: 15
 - Forks: 120
 - Open Issues: 22
 - 
            Metadata Files:
            
- Readme: README.md
 
 
Awesome Lists containing this project
- awesome-list - imablanco/Zoomy - Zoomy is an easy to use pinch-to-zoom Android library (Java)
 - awesome-github-android-ui - Zoomy - 缩放Android库 (图片)
 - Android-Awesome-Resources - Zoomy
 
README
          
# Zoomy
Zoomy is an easy to use pinch-to-zoom Android library

## Installation
```gradle
implementation 'io.github.imablanco:zoomy:{latest version}'
```
## Usage 
To start using Zoomy, just register the View you want to be zoomable
```java
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
```java
Zoomy.unregister(mZoomableView');
            
```
## Customization
Zoomy allows a few customizations in its behavior:
+ Use ZoomyConfig to change default configuration flags
```java
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
```java
Zoomy.setDefaultConfig(config);           
```
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.
```java
    Zoomy.Builder builder = new Zoomy.Builder(this)
                    .target(mZoomableView)
                    .enableImmersiveMode(false)
                    .animateZooming(false);
```
+ 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.
```java
 Zoomy.Builder builder = new Zoomy.Builder(this)
                    .target(mZoomableView)
                    .tapListener(new TapListener() {
                        @Override
                        public void onTap(View v) {
                            //View tapped, do stuff
                        }
                    })
                     .longPressListener(new LongPressListener() {
                        @Override
                        public void onLongPress(View v) {
                            //View long pressed, do stuff
                        }
                    }).doubleTapListener(new DoubleTapListener() {
                        @Override
                        public void onDoubleTap(View v) {
                            //View double tapped, do stuff
                        }
                    })
                    .zoomListener(new ZoomListener() {
                        @Override
                        public void onViewStartedZooming(View view) {
                            //View started zooming
                        }
                        @Override
                        public void onViewEndedZooming(View view) {
                            //View ended zooming
                        }
                    });        
```
+ It is possible to change the interpolator used when animating ending zoom event.
```java
   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.