Skip to content

neofly/PickPhotoSample

 
 

Repository files navigation

PickPhotoView

A Library help u to pick photos.

Click to download lastest demo ⬇️ or select Release Version

download

Last Update (2017.7.6)

  1. support select gif
  2. update image preview and select logic
  3. optimize UI

Thanks Ray Li Pull requests

Screenshot

screenshotscreenshot

screenshot screenshotscreenshot

screenshotscreenshot

Dependency

License last-version

the last-version is releases-version

Gradle

  compile 'com.werb.pickphotoview:pickphotoview:0.3.0'  // 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
        .setSelectIconColor("#00C07F")  // custom select 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) {
            ArrayList<String> selectPaths = (ArrayList<String>) data.getSerializableExtra(PickConfig.INTENT_IMG_LIST_SELECT);
            // do something u want
        }
    }

License

Apache2.0

About

Photo Picker Of Android Library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%