diff --git a/README.md b/README.md index 70cd710..393307a 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ An Android library project to provide a simple image cropping `Activity`, based on code from AOSP. -[![build status](https://travis-ci.org/jdamcd/android-crop.png)](https://travis-ci.org/jdamcd/android-crop) +[![build status](https://travis-ci.org/jdamcd/android-crop.svg)](https://travis-ci.org/jdamcd/android-crop) [![maven central](https://img.shields.io/badge/maven%20central-1.0.1-brightgreen.svg)](http://search.maven.org/#artifactdetails%7Ccom.soundcloud.android%7Candroid-crop%7C1.0.1%7Caar.asc) [![changelog](https://img.shields.io/badge/changelog-1.0.1-lightgrey.svg)](CHANGELOG.md) @@ -18,20 +18,26 @@ An Android library project to provide a simple image cropping `Activity`, based First, declare `CropImageActivity` in your manifest file: -`` +```xml + +``` #### Crop -`Crop.of(inputUri, outputUri).asSquare().start(activity)` +```java +Crop.of(inputUri, outputUri).asSquare().start(activity) +``` Listen for the result of the crop (see example project if you want to do some error handling): - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent result) { - if (requestCode == Crop.REQUEST_CROP && resultCode == RESULT_OK) { - doSomethingWithCroppedImage(outputUri); - } +```java +@Override +protected void onActivityResult(int requestCode, int resultCode, Intent result) { + if (requestCode == Crop.REQUEST_CROP && resultCode == RESULT_OK) { + doSomethingWithCroppedImage(outputUri); } +} +``` Some options are provided to style the crop screen. See example project theme. @@ -39,13 +45,17 @@ Some options are provided to style the crop screen. See example project theme. The library provides a utility method to start an image picker: -`Crop.pickImage(activity)` +```java +Crop.pickImage(activity) +``` #### Dependency The AAR is published on Maven Central: -`compile 'com.soundcloud.android:android-crop:1.0.1@aar'` +```groovy +compile 'com.soundcloud.android:android-crop:1.0.1@aar' +``` #### Users