explaingit

baseflow/photoview

Analysis updated 2026-06-21

18,834JavaAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

An Android library that adds pinch-to-zoom and double-tap zoom to image views with a two-line Gradle install, a drop-in replacement for Android's default ImageView that makes photos interactive.

Mindmap

mindmap
  root((PhotoView))
    Gestures
      Pinch to zoom
      Double-tap zoom
      Fling and pan
    Integration
      Replaces ImageView
      Works in ViewPager
      Two-line Gradle setup
    Use Cases
      Photo galleries
      Product images
      Map viewers
    Platform
      Android Java
      Apache 2.0
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add pinch-to-zoom to a photo gallery screen in your Android app in under five minutes.

USE CASE 2

Build a product detail screen in an Android e-commerce app where users can zoom into item photos for detail.

USE CASE 3

Display a high-resolution map image in an Android app that users can pan and zoom with finger gestures.

USE CASE 4

Add zoomable image support inside a swipeable ViewPager photo gallery.

What is it built with?

JavaAndroid

How does it compare?

baseflow/photoviewdromara/sa-tokenantlr/antlr4
Stars18,83418,80218,874
LanguageJavaJavaJava
Setup difficultyeasyeasymoderate
Complexity1/52/54/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Use freely in any project including commercial apps, as long as you include the Apache 2.0 license notice.

In plain English

PhotoView is an Android library that adds pinch-to-zoom and double-tap zoom to image views in your app. Android's built-in ImageView widget displays pictures but doesn't let users zoom into them with their fingers, PhotoView solves that problem with a drop-in replacement that behaves just like a normal image widget but adds smooth zooming and scrolling gestures on top. It supports multi-touch pinch gestures, double-tap to zoom in and out, and smooth fling scrolling when panning around a zoomed image. It also works correctly when placed inside a swipeable container like ViewPager, which is the component commonly used for photo galleries. Developers can listen for zoom level changes or tap events to update other parts of their UI when the user interacts with the photo. You would use this library if you are building an Android app in Java that shows photos and wants users to be able to zoom in for detail, for example a photo gallery, an image viewer, a product photo screen in an e-commerce app, or a map image. Adding it requires just two lines of Gradle dependency setup and replacing your ImageView tag with a PhotoView tag. It is licensed under the Apache License 2.0.

Copy-paste prompts

Prompt 1
How do I add the PhotoView library to my Android Gradle project and replace my existing ImageView with a zoomable version?
Prompt 2
Show me how to detect when a user double-taps a PhotoView in Android and update a zoom level text label in my UI.
Prompt 3
How do I put PhotoView inside a ViewPager so users can swipe between photos and also pinch-zoom each one independently?
Prompt 4
What's the minimum Android code to display a remote image loaded by Glide in a PhotoView with pinch-to-zoom enabled?

Frequently asked questions

What is photoview?

An Android library that adds pinch-to-zoom and double-tap zoom to image views with a two-line Gradle install, a drop-in replacement for Android's default ImageView that makes photos interactive.

What language is photoview written in?

Mainly Java. The stack also includes Java, Android.

What license does photoview use?

Use freely in any project including commercial apps, as long as you include the Apache 2.0 license notice.

How hard is photoview to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is photoview for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub baseflow on gitmyhub

Verify against the repo before relying on details.