Merge pull request #171 from dlackty/tweak-readme
Add syntax highlighting and SVG badge
This commit is contained in:
commit
946e959302
30
README.md
30
README.md
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
An Android library project to provide a simple image cropping `Activity`, based on code from AOSP.
|
||||
|
||||
[](https://travis-ci.org/jdamcd/android-crop)
|
||||
[](https://travis-ci.org/jdamcd/android-crop)
|
||||
[](http://search.maven.org/#artifactdetails%7Ccom.soundcloud.android%7Candroid-crop%7C1.0.1%7Caar.asc)
|
||||
[](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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue