Viewing code Guide

Advice from simple MultiTouchGestureDetector, see the principle. And then, look at the PhotoView and see how elegant the structure is. Run a more complete function of the Demo PinchImageView, modify to achieve a simple. Finally, to integrate more sophisticated features, use Stfalcon ImageViewer directly.

1.PhotoView17.2 k (star)

Many libraries are based on his changes, the code logic is clear

PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView.

  • Out of the box zooming, using multi-touch and double-tap.
  • Scrolling, with smooth scrolling fling.
  • Works perfectly when used in a scrolling parent (such as ViewPager).
  • Allows the application to be notified when the displayed Matrix has changed. Useful for when you need to update your UI based on the current zoom/scroll position.
  • Allows the application to be notified when the user taps on the Photo.

2.Stfalcon ImageViewer1.4 k (star)

The code style is KT and the integration degree is relatively high

A simple and customizable full-screen image viewer with shared image transition support, “pinch to zoom” and “swipe to dismiss” gestures. Compatible with all of the most popular image processing libraries such as Picasso, Glide etc. Based on PhotoView by chrisbanes.

3.PinchImageView1.8 k (star)

Only one class, fully functional, code easy to modify integration.

This is a great gesture experience but uses a simple ImageView control to make gestures zoom in and out, panning and so on. PinchImageView inherits from ImageView and can be used whenever an ImageView is available. The entire program is only a class file, not dependent on any special external libraries, very easy to integrate

  1. The gesture control, combined with the ViewPlayer, loads a thumbnail when the picture is not on the current page and updates to a larger image when you switch to the current page.
  2. Click on the thumbnail to switch to a larger image to browse using the zoom animation transition; Use animated transitions from large images to thumbnails when returned. Smooth transitions are ensured regardless of the position of the large graph to state and small graph.
  3. When viewing oversized images, use the fragment loading policy to avoid OOM.

4.GestureViews(2.1 k)

There is a lot of code, the core code gestureController.java, add a variety of animation, have to work hard to see.

ImageView and FrameLayout with gestures control and position animation. Main goal of this library is to make images viewing process as smooth as possible and to make it easier for developers to integrate it into their apps.

5.MultiTouchGestureDetector(star, 214).

Simple code, decoupled from a specific view, easy to modify and integrate.

MultiTouchGestureDetector by providing the MotionEvent unified handling scaling, rotating, mobile signal transformation. When change any perceptible gestures, OnMultiTouchGestureListener callback will be triggered, moreover SimpleOnMultiTouchGestureListener is a helper class, if you don’t need to care about all the callback event, It can be inherited first. This class must inject the View’s touch event.