Merge pull request #171 from dlackty/tweak-readme

Add syntax highlighting and SVG badge
This commit is contained in:
Jamie McDonald 2015-11-20 13:58:19 +01:00
commit 946e959302
1 changed files with 20 additions and 10 deletions

View File

@ -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:
`<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.
@ -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