#PickerChu
PickerChu is an image pick-and-crop library for Android pika.
##Integration
Simply add the following line to the dependencies
section of your build.gradle
file:
compile 'mlxy.pickerchu:pickerchu:1.1.2'
##For Eclipse users
Just copy and paste all files from /PickerChu/src/main/java/mlxy/pickerchu
to anywhere in your src
folder, that'll work too.
Although I highly recommend you to migrate your Android projects to Android Studio.
##Usage
-
Build a
PickerChu
in your code:pickerChu = new PickerChu.Builder(this) .needToCrop(true) .saveIn(getExternalCacheDir()) .byAspectRatioOf(1, 1) .inSizeOf(1024, 1024) .onImageCropped(new PickerChu.OnImageCroppedListener() { @Override public void onImageCropped(Uri imageUri) { // imageView.setImageURI(imageUri); } }) .build();
Note: You may not need all of those builder methods above, see JavaDoc for more details.
-
Handle
onActivityResult()
event:@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { this.pickerChu.handleActivityResult(requestCode, resultCode, data); }
-
Choose a way to get a picture:
pickerChu.pickPicture();
or:
pickerChu.takePhoto();
-
Enjoy :)
##Author
Chihane Habana
##License