Go to file
Jamie McDonald 2fa1be3329 Moved Exif helpers to utils 2014-03-15 00:13:31 +01:00
example Formatting 2014-03-14 23:15:44 +01:00
gradle/wrapper Empty project 2014-03-12 11:47:34 +01:00
lib Moved Exif helpers to utils 2014-03-15 00:13:31 +01:00
.gitignore Empty project 2014-03-12 11:47:34 +01:00
README.md More README updates than image cropping libraries 2014-03-13 22:25:12 +01:00
android-crop.iml Formatting 2014-03-14 23:15:44 +01:00
build.gradle Setting build group and version 2014-03-14 22:25:59 +01:00
gradle.properties Empty project 2014-03-12 11:47:34 +01:00
gradlew Removed annotation dependency to make build work 2014-03-12 14:21:52 +01:00
gradlew.bat Empty project 2014-03-12 11:47:34 +01:00
screenshot.png Updated README & screenshot 2014-03-13 22:12:54 +01:00
settings.gradle Added empty example project 2014-03-12 12:33:18 +01:00

README.md

I guess people are just cropping out all the sadness

This is yet another Android library project providing a simple image cropping Activity, based on code from AOSP.

Goals

I started this in my hacker time with the intention of replacing our dated android-cropimage fork.

  • Gradle build
  • AAR & ApkLib artifacts
  • Backwards compatible to Gingerbread
  • Example project
  • Add tests and strip out unused complexity
  • Better programming interface
  • Modern user interface
  • Fix bugs!

Usage

First, declare CropImageActivity in your manifest file:

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

Crop

new Crop(inputUri).output(outputUri).asSquare().start(activity)

Listen for the result of the crop:

protected void onActivityResult(int requestCode, int resultCode, Intent result) {
    if (resultCode == RESULT_OK && requestCode == Crop.REQUEST_CROP) {
        if (Crop.isError(result)) {
        	// Do some error handling with Crop.getError(result)
    	} else {
        	// Do something with your cropped image!
    	}
    }
}

Pick

The library provides a utility method to start an image picker:

Crop.pickImage(activity)

How does it look?

android-crop screenshot

License & Credits

Apache License, version 2. Most of the cropping code is from AOSP. Thanks to android-cropimage contributors.