# CommentGallery
**Repository Path**: zjf_ht/CommentGallery
## Basic Information
- **Project Name**: CommentGallery
- **Description**: An android image gallery with Fresco
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-05-24
- **Last Updated**: 2020-12-19
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# CommentGallery
This project contains serval librarys for demonstrating image gallery with [Fresco](https://github.com/facebook/fresco)'s [ZoomableDraweeView](https://github.com/facebook/fresco/blob/master/samples/zoomable/src/main/java/com/facebook/samples/zoomable/ZoomableDraweeView.java)(Use the optimized version I made), such as image grid and large image viewer
which supports zoom-in and zoom-out. Please feel free to let me know if your have any questions.

## Gradle Dependency
Add the JitPack repository to your build file:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```
## Usage
### 1. Usage of ZoomableDraweeView
I've optimized some default behaviors to the official ZoomableDraweeView to make it more perfect.
- Add the dependency
```
dependencies {
compile 'com.github.ibosong.CommentGallery:frescozoomablelib:1.0.1'
}
```
- Use `ZoomableDraweeView` as the Fresco `SimpleDraweeView`.
### 2. Usage of LargeImageGallery
- Add the dependency
```
dependencies {
compile 'com.github.ibosong.CommentGallery:largeimagegallerylib:1.0.1'
}
```
- Add LargeImageGallery to your xml file.
```
```
- Set image urls with `setData(List urls)` method.
That's all. There are also some listeners your can set:
```
mLargeImageGallery.setOnImageSelectedListener(this);
mLargeImageGallery.setOnItemClickListener(this);
```
### 3. Usage of CommentImageGrid
- Add the dependency
```
dependencies {
compile 'com.github.ibosong.CommentGallery:commentgallerylib:1.0.1'
}
```
- Add CommentImageGrid to xml layout file
```
```
- Attribures
Attribure| Usage
-|-
placeholder_image | set placeholder image
fallback_image | set fallback image
horizontal_space | horizontal space between items
vertical_space | vertical space between items
- Set image urls with `List`
```
mCommentGrid.setData(urls);
```
## Attentions
You may do some compress works for the large image before rendering to avoid the error "OpenGLRenderer: Bitmap too large to be uploaded into a texture".
## Last thing
Enjoy yourself!