Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/laomengzhu/MutiPhotoChoser

可以多选的图片选择器
https://github.com/laomengzhu/MutiPhotoChoser

Last synced: about 1 month ago
JSON representation

可以多选的图片选择器

Awesome Lists containing this project

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