PickPhotoView
A Library help u to pick photos.
Click to download lastest demo
Last Update (2017.4.27)
v0.1.5
- remove Provider in lib Manifest
so you must register Manifest this code in your app AndroidManifest
<provider
android:name="com.werb.pickphotoview.provider.PickProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/pick_file_paths"/>
</provider>
Update (2017.4.17)
v0.1.2
- fix bug in when select image size is empty
- update gradle version to 3.3
Add Four new Method
new PickPhotoView.Builder(context)
.setPickPhotoSize(9) //select max size
.setShowCamera(true) //is show camera
.setSpanCount(4) //SpanCount
.setLightStatusBar(true) // custom theme
.setStatusBarColor("#ffffff") // custom statusBar
.setToolbarColor("#ffffff") // custom toolbar
.setToolbarIconColor("#000000") // custom toolbar icon
.start();
Screenshot
Dependency
the last-version is releases-version️
Gradle
compile 'com.werb.pickphotoview:pickphotoview:0.1.5' // Last Version
some Library already dependency
- Glide
- Recyclerview
- Gson
If you don't want to dependency this Library version , you can replace it just like
compile ('com.werb.pickphotoview:pickphotoview:last-version',{
exclude group: 'com.google.code.gson'
})
compile 'com.google.code.gson:gson:XXXX'
Maven
<dependency>
<groupId>com.werb.pickphotoview</groupId>
<artifactId>pickphotoview</artifactId>
<version>last-version</version>
<type>pom</type>
</dependency>
Eclipse
Sorry ,You are out !
Usage
Make sure you have permissions about CAMERA and WRITE/READ_EXTERNAL_STORAGE before use
PermissionsChecker : A Library help u to check permissions on Android M.
Register Provider in your app AndroidManifest.xml
<provider
android:name="com.werb.pickphotoview.provider.PickProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/pick_file_paths"/>
</provider>
Initialize PickPhotoView
new PickPhotoView.Builder(context)
.setPickPhotoSize(9) //select max size
.setShowCamera(true) //is show camera
.setSpanCount(4) //SpanCount
.setLightStatusBar(true) // custom theme
.setStatusBarColor("#ffffff") // custom statusBar
.setToolbarColor("#ffffff") // custom toolbar
.setToolbarIconColor("#000000") // custom toolbar icon
.start();
onActivityResult
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == 0){
return;
}
if(data == null){
return;
}
if (requestCode == PickConfig.PICK_PHOTO_DATA) {
List<String> selectPaths = (List<String>) data.getSerializableExtra(PickConfig.INTENT_IMG_LIST_SELECT);
// do something u want
}
}