Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures

Min SDK   15
Latest Commit   2017-07-19 08:38:22
License   

Github   https://github.com/stfalcon-studio/FrescoImageViewer

         

标签

使用APP客户端扫描二维码运行Demo


         

类似的还有....
PhotoView 图片浏览缩放控件
TextWithImageDrawable 图文混排的drawable An android drawable object which contains text and image and even complex drawable
MultiImageSelector Deprecated -- Image selector for Android device. Support single choice and multi-choice.
README

README.md

FrescoImageViewer

codebeat badge Download

Simple customizable full screen image viewer for Fresco library that includes "pinch to zoom" and "swipe to dismiss" gestures. Based on PhotoDraweeView by ongakuer.

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.

Requirements

  • Fresco v.0.12.0 and higher
  • SDK 14 and and higher

Demo Application

Get it on Google Play

Usage

Simple usage

All you need to show a viewer is pass the context, start position and List or String[] into builder and call show().

new ImageViewer.Builder(context, list)
        .setStartPosition(startPosition)
        .show();

Custom objects

But what if in your application images are represented not only with urls? For example, you have object with url and description? You'll have to convert it to list of Strings and only then pass it to viewer, right? No, it's unnecessary! With ImageViewer.Formatter you can pass list of your custom images to viewer and simply write a rule for url extracting:

List<CustomImage> images = getImages();
new ImageViewer.Builder<>(this, images)
        .setFormatter(new ImageViewer.Formatter<CustomImage>() {
            @Override
            public String format(CustomImage customImage) {
                return customImage.getUrl();
            }
        })
        .show();

If formatter isn't passed, Object.toString() will be used for image formatting as default behavior.

Piece of cake!