PoiPhoto
介绍:
一个简单的图片选择器。
运行效果:
使用说明:
Gradle
compile 'com.flying.xiaopo:poiphoto:0.2.0'
AndroidManifest.xml
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="23"/>
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="23"/>
Java
PhotoPicker.newInstance()
.setAlbumTitle("Album")
.setPhotoTitle("Photo")
.setToolbarColor(Color.BLACK)
.setToolbarTitleColor(Color.WHITE)
.setMaxNotice("can not select more") //the message when user selected photos too more
.setStatusBarColor(Color.BLACK) //when sdk >21 ,it will work
.setMaxCount(6) //max count of selected count
.pick(MainActivity.this); //cont
To Get Data
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode == RESULT_OK && requestCode == Define.DEFAULT_REQUEST_CODE) {
//to get path of the selected photos
List<String> paths = data.getStringArrayListExtra(Define.PATHS);
//to get datatype of photo of the selected photos
List<Photo> photos = data.getParcelableArrayListExtra(Define.PHOTOS);
}
}
已下载
0