Code Monkey home page Code Monkey logo

draggableimageviewer's Introduction

一款类似 微信/B站 的图片浏览组件, 主要具有以下特点:

  1. 类似共享元素的入场&退场动画(图片在入场时给人一种渐渐展开的效果)
  2. 拖拽&双击退出图片查看
  3. 支持缩放手势
  4. 支持查看长图
  5. 支持查看原图 & 下载原图
  6. 支持显示GIF & 可复用Glide的Bitmap内存缓存,避免OOM

快速使用

引入

dependencies {
    implementation 'com.susion:image-viewer:1.0.2'
}

展示一张图片:

ImageViewerHelper.showSimpleImage(context, url, imageView)

展示多张图片:

val imags = ArrayList<ImageViewerHelper.ImageInfo>()
imags.add(ImageViewerHelper.ImageInfo(url1))
imags.add(ImageViewerHelper.ImageInfo(url2))
ImageViewerHelper.showImages(this, listOf(mImagesIv1, mImagesIv2, mImagesIv3), imags, index)

缩略图的展示

支持优先展示缩略图,然后缓慢加载原图:

ImageViewerHelper.showSimpleImage(this, ImageViewerHelper.ImageInfo(thumbnailUrl, imgSize), imageView)

效果展示

gif1

gif1

gif1

draggableimageviewer's People

Contributors

susionsuc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.