Skip to content

Commit c0581f1

Browse files
committed
update readme
1 parent da63e2b commit c0581f1

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ Include the library
2424
2. Add `CropImageActivity` into your AndroidManifest.xml
2525
```xml
2626
<activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity"
27-
android:theme="@style/Base.Theme.AppCompat"/>
27+
android:theme="@style/Base.Theme.AppCompat"/> <!-- optional (needed if default theme has no action bar) -->
2828
```
2929

3030
3. Start `CropImageActivity` using builder pattern from your activity
3131
```java
3232
CropImage.activity(imageUri)
3333
.setGuidelines(CropImageView.Guidelines.ON)
3434
.start(this);
35+
36+
// for fragment (DO NOT use `getActivity()`)
37+
CropImage.activity(imageUri)
38+
.start(getContext(), this);
3539
```
3640

3741
4. Override `onActivityResult` method in your activity to get crop result
@@ -71,7 +75,7 @@ Include the library
7175
4. Get cropped image
7276
```java
7377
Bitmap cropped = cropImageView.getCroppedImage();
74-
// or (must subscribe to async event using cropImageView.setOnGetCroppedImageCompleteListener(listener))
78+
// or (must subscribe to async event using cropImageView.setOnCropImageCompleteListener(listener))
7579
cropImageView.getCroppedImageAsync();
7680
```
7781

@@ -83,7 +87,8 @@ Include the library
8387
- Auto rotate bitmap by image Exif data.
8488
- Set result image min/max limits in pixels.
8589
- Set initial crop window size/location.
86-
- Bitmap memory optimization.
90+
- Request cropped image resize to specific size.
91+
- Bitmap memory optimization, OOM handling (should never occur)!
8792
- API Level 10.
8893
- More..
8994

@@ -104,7 +109,17 @@ For more information, see the [GitHub Wiki](https://github.com/ArthurHub/Android
104109
## Change log
105110
*2.3.0*
106111

107-
112+
- Change required width/height behavior to support resizing (inside/fit/exact) see wiki for details.
113+
- Add sampling fallback to lower cropped image resolution on OOM error (if image loaded from URI).
114+
- Setting aspect ratio will also set it to fixed, to help with confusion, add clear aspect ratio method.
115+
- Add support for setting min/max crop result size in code on CropImageView.
116+
- Fix cropping failing bug when skia fails region cropping.
117+
- Add Fallback to Intent.ACTION_PICK if no intent found for Intent.ACTION_GET_CONTENT (thx geolyth)
118+
- Multi touch support for cropping window (experimental, thx bbwharris)
119+
- **BREAKING CHANGES**:
120+
- If you previously used requested width/height the default behavior now is to resize inside the cropped image, to preserve the previous behavior you need to pass the SAMPLING option.
121+
- `OnGetCroppedImageCompleteListener` and `OnSaveCroppedImageCompleteListener` is deprecated, use `OnCropImageCompleteListener` that combines the two and provides the result object as crop activity.
122+
- Set aspect ratio also sets fixed aspect ratio to true, if this is not the desired behavior set the fix aspect ratio flag manually or call the method after calling set aspect ratio.
108123

109124
*2.2.5*
110125

0 commit comments

Comments
 (0)