Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/laomengzhu/MutiPhotoChoser
可以多选的图片选择器
https://github.com/laomengzhu/MutiPhotoChoser
Last synced: about 1 month ago
JSON representation
可以多选的图片选择器
- Host: GitHub
- URL: https://github.com/laomengzhu/MutiPhotoChoser
- Owner: laomengzhu
- License: mpl-2.0
- Created: 2015-06-24T08:38:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-13T02:41:46.000Z (over 9 years ago)
- Last Synced: 2024-08-02T01:22:13.795Z (4 months ago)
- Language: Java
- Size: 5.82 MB
- Stars: 132
- Watchers: 10
- Forks: 33
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-android-ui - MutiPhotoChoser - 支持多选的图片选择器 (图片)
README
# MutiPhotoChoser
一款支持多选的图片选择器,支持Android2.0+
![Screenshot](https://raw.githubusercontent.com/xiaolifan/MutiPhotoChoser/master/ScreenShot/2015-06-24_172813.jpg)
## 使用(详见app目录)
### 配置AndroidManifest.xml
1、添加权限:
``` xml
```2、声明GalleryActivity:
``` xml
```
### 调起图片选择页面选择图片
``` java
//***改成应用的包名
Intent intent = new Intent("***.action.CHOSE_PHOTOS");
//指定图片最大选择数
intent.putExtra(Constant.EXTRA_PHOTO_LIMIT, 5);
startActivityForResult(intent, REQUEST_PICK_PHOTO);
```### 处理选择结果
``` java
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode != Activity.RESULT_OK) {
return;
}switch (requestCode) {
case REQUEST_PICK_PHOTO:
ArrayList images = data.getStringArrayListExtra(Constant.EXTRA_PHOTO_PATHS);
mAdaper.swapDatas(images);
break;
}
}
```## 项目依赖
该库使用了"Android-Universal-Image-Loader"处理图片缓存,github地址:[https://github.com/nostra13/Android-Universal-Image-Loader](https://github.com/nostra13/Android-Universal-Image-Loader);
## License
Mozilla Public License, version 2.0