https://github.com/junixapp/imagegridview
【不再维护】微博,微信九宫格图片布局,搭配XPopup的大图浏览弹窗,体验好到飞起。
https://github.com/junixapp/imagegridview
Last synced: about 1 year ago
JSON representation
【不再维护】微博,微信九宫格图片布局,搭配XPopup的大图浏览弹窗,体验好到飞起。
- Host: GitHub
- URL: https://github.com/junixapp/imagegridview
- Owner: junixapp
- Created: 2019-04-02T15:22:52.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-02T15:37:27.000Z (about 7 years ago)
- Last Synced: 2025-04-02T14:02:15.291Z (about 1 year ago)
- Language: Java
- Homepage:
- Size: 2.96 MB
- Stars: 19
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ImageGridView
微博,微信九宫格图片布局,配上目前可能是Android最好的大图浏览效果。
由[https://github.com/jeasonlzy/NineGridView](https://github.com/jeasonlzy/NineGridView)修改而来。
## Demo

## 使用

添加依赖
```groovy
implementation 'com.lxj:imagegridview:最新版本'
```
使用:
```kotlin
imageGrid.setAdapter(object : ImageGridAdapter(this, t.list) {
override fun onImageItemClick(
context: Context,
gridView: ImageGridView,
position: Int,
urls: MutableList
) {
//使用XPopup展示大图
val urls2 = ArrayList()
urls.forEach { urls2.add(it) }
XPopup.Builder(context).asImageViewer(
gridView.getChildAt(position) as ImageView, position, urls2,
{ popupView, position ->
popupView.updateSrcView(gridView.getChildAt(position) as ImageView)
}, ImageLoader()
).show()
}
override fun loadImage(imageView: ImageView, position: Int, url: String) {
//只需要实现这一个方法
imageView.load(url = url, isCrossFade = true, placeholder = R.drawable.ic_default_color,
isForceOriginalSize = true)
}
})
}
```