Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
wangpeng committed Jan 30, 2020
1 parent d230fc9 commit 603e37f
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,40 @@
### 图片浏览器

- 支持左右/上下滑动(基于ViewPager2)
- 支持常有图片操作手势(基于PhotoView
- 支持查看超大图(基于SubsamplingScaleImageView
- 支持简单的下拽退出
- 支持进入退出动画
- 支持数据内容异步追加(向前翻页.聊天/帖子历史记录中的图片查看等)
- 支持左右翻页滑动&上下翻页滑动
- 支持常用的图片操作手势.双击放大/缩小等(基于[PhotoView](https://github.com/chrisbanes/PhotoView)
- 支持查看超大图(基于[SubsamplingScaleImageView](https://github.com/davemorrissey/subsampling-scale-image-view)
- 支持下拽退出手势
- 支持进入&退出动画
- 支持数据分页加载

#### 使用
```
implementation 'com.github.iielse.imageviewer:imageviewer:2.0.1'
```
```
ImageViewerBuilder(
context = this,
initKey = photo.id,
dataProvider = MyDataProvider(),
imageLoader = MyImageLoader(),
transformer = MyTransformer()
).show()
val builder = ImageViewerBuilder(
context = this,
initKey = photo.id,
dataProvider = MyDataProvider(),
imageLoader = MyImageLoader(),
transformer = MyTransformer()
)
builder.setVHCustomizer(MyCustomViewHolderUI())
builder.setOverlayCustomizer(MyCustomIndicatorUI())
builder.setViewerCallback(MyViewerStateChangedListener())
builder.show()
```

主要接口 | 作用介绍
--- | ---
DataProvider | 提供浏览数据源.支持分页异步加载更多数据
ImageLoader | 提供数据对应视图的加载方案.以及超大图的加载方案
Transformer | 确定被浏览的控件和页面上原有控件的对应关系
VHCustomizer |自定义每页浏览UI
OverlayCustomizer |自定义覆盖在Viewer之上的UI
ViewerCallbackAdapter | 提供页面滑动及浏览内容被下拽返回的状态回调


#### TODO
- 适配RTL问题

Expand Down

0 comments on commit 603e37f

Please sign in to comment.