Go to file
Jamie McDonald fced0cfd49 Added screenshot 2014-03-13 11:22:10 +01:00
example Fixed a couple of lint issues 2014-03-13 00:14:54 +01:00
gradle/wrapper Empty project 2014-03-12 11:47:34 +01:00
lib Fixed a couple of lint issues 2014-03-13 00:14:54 +01:00
.gitignore Empty project 2014-03-12 11:47:34 +01:00
README.md Added README content 2014-03-13 09:43:05 +01:00
android-crop.iml Added empty example project 2014-03-12 12:33:18 +01:00
build.gradle Empty project 2014-03-12 11:47:34 +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 Added screenshot 2014-03-13 11:22:10 +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. It's based on the same AOSP code as the others.

Goals

  • Gradle build
  • Backwards compatible to Gingerbread
  • Example project
  • Add tests and strip out unused complexity
  • Better programming interface
  • Modern user interface
  • Move error handling to result code
  • Fix bugs!
  • Keep improvements from SoundCloud fork of android-cropimage

Usage

Crop

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

Listen for the result of the crop in onActivityResult(...):

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

There is a util method to start an image picker:

Crop.pickImage(activity)

License & Credits

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