A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Clone or download
Latest commit 9081fa1 Dec 19, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE Update issue templates Dec 18, 2018
gradle/wrapper First commit Dec 17, 2018
images Add demo images Dec 17, 2018
imageviewer Tiny refactoring Dec 17, 2018
sample Fix demo images path Dec 17, 2018
.gitignore First commit Dec 17, 2018
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md Dec 18, 2018
LICENSE Create LICENSE Dec 18, 2018
README.md Update README.md Dec 19, 2018
build.gradle Add Bintray release config Dec 17, 2018
gradle.properties First commit Dec 17, 2018
gradlew First commit Dec 17, 2018
gradlew.bat First commit Dec 17, 2018
settings.gradle First commit Dec 17, 2018


codebeat badge Codacy Badge Download License

Stfalcon ImageViewer

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.

alt tag alt tag

Who we are

Need iOS and Android apps, MVP development or prototyping? Contact us via info@stfalcon.com. We develop software since 2009, and we're known experts in this field. Check out our portfolio and see more libraries from stfalcon-studio.


  • A project configured with the AndroidX
  • SDK 19 and and higher

Demo Application

Get it on Google Play


Download via Gradle:

Add this to the project build.gradle file:

allprojects {
    repositories {
        maven { url "https://jitpack.io" }

And then add the dependency to the module build.gradle file:

implementation 'com.github.stfalcon:stfalcon-imageviewer:latest_version'

Download via Maven:


Where the latest_version is the value from Download badge.


Simple usage

All you need to show the viewer is to pass the context, list or array of your image objects and the implementation of the ImageLoader and call the show() method:

StfalconImageViewer.Builder<Image>(context, images) { view, image ->

Piece of cake!

Transition animation

To improve the UX of your app you would like to add a transition when a user opens the viewer. And this is simple as never before! Just tell the viewer which image should be used for animation using withTransitionFrom(myImageView) method and the library will do it for you!

If you need more advanced behavior like updating transition target while changing images in the viewer please see the sample app for how to do this.

Update images list on the fly

There are a lot of common cases (such as pagination, deleting, editing etc.) where you need to update the existing images list while the viewer is running. To do this you can simply update the existing list (or even replace it with a new one) and then call updateImages(images).

Custom overlay view

If you need to show some content over the image (e.g. sharing or download button, description, numeration etc.) you can set your own custom view using the setOverlayView(customView) and bind it with the viewer through the ImageViewer.OnImageChangeListener.


Use the setBackgroundColorRes(colorRes) or setBackgroundColor(colorInt) to set a color of the fading background.

Images margin

Simply add margins between images using the withImagesMargin(context, dimenRes) method for dimensions, or use the withImageMarginPixels(int) for pixels size.

Container padding

Overlay image hides part of the images? Set container padding with dimens using withContainerPadding(context, start, top, end, bottom) or withContainerPadding(context, dimen) for all of the sides evenly. For setting a padding in pixels, just use the withContainerPadding(...) methods variant.

Status bar visibility

Control the status bar visibility of the opened viewer by using the withHiddenStatusBar(boolean) method (true by default)


If you need to disable some of the gestures - you can use the allowSwipeToDismiss(boolean) and allowZooming(boolean) methods accordingly.

Options overview

Here is the example with all of the existing options applied:

StfalconImageViewer.Builder<String>(this, images, ::loadImage)
            //.withContainerPadding(R.dimen.paddingStart, R.dimen.paddingTop, R.dimen.paddingEnd, R.dimen.paddingBottom)
            //.withContainerPaddingPixels(paddingStart, paddingTop, paddingEnd, paddingBottom)

Also, you can take a look at the sample project for more information.

Usage with Fresco

If you use the Fresco library - check out the FrescoImageViewer which was also developed by our team.


Copyright (C) 2018 stfalcon.com

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.