Skip to content

Commit

Permalink
Merge pull request jdamcd#171 from dlackty/tweak-readme
Browse files Browse the repository at this point in the history
Add syntax highlighting and SVG badge
  • Loading branch information
jdamcd committed Nov 20, 2015
2 parents 0f8b5ae + d981090 commit 946e959
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -18,34 +18,44 @@ An Android library project to provide a simple image cropping `Activity`, based

First, declare `CropImageActivity` in your manifest file:

`<activity android:name="com.soundcloud.android.crop.CropImageActivity" />`
```xml
<activity android:name="com.soundcloud.android.crop.CropImageActivity" />
```

#### 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.

#### Pick

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

Expand Down

0 comments on commit 946e959

Please sign in to comment.