Skip to content

brittle123/PoiPhoto

 
 

Repository files navigation

PoiPhoto

A simple Photo Selecter

What is PoiPhoto

PoiPhoto is a simple lib to select photos for Android.
##How to use ###Gradle

compile 'com.flying.xiaopo:poiphoto:0.4.2'

###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);   //context

also

PhotoPicker.newInstance()
                .inflate(RecyclerView, RecyclerView.LayoutManager);

or just get data

PhotoManager photoManager = new PhotoManager(context);

###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);
    }
}

About

A simple Photo Selecter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%