Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.0.0 #275

Merged
merged 13 commits into from
Nov 30, 2021
19 changes: 14 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [unreleased]
### Removed
- Removed ProGuard rule from ReadMe [#257](https://github.com/CanHub/Android-Image-Cropper/issues/257)
- Removed unused dependencies and settings from Gradle files [#265](https://github.com/CanHub/Android-Image-Cropper/issues/265)
## [unreleased 4.0.0] - 28/11/21
### Fixed
- Issue where some devices based on MIUI would not retrieve image from gallery [#253](https://github.com/CanHub/Android-Image-Cropper/issues/253)

### Changed
- `minSdkVersion = 16`, previous versions have been deprecated by Google.

## [3.3.6] - 05/11/21
### Added
- Added `PickImageContractOptions` to enable users specify image source [#226](https://github.com/CanHub/Android-Image-Cropper/issues/226)
- Added option to enable users specify image source [#226](https://github.com/CanHub/Android-Image-Cropper/issues/226)

### Removed
- Pick Image, now the library will handle this without expose the contract [#271](https://github.com/CanHub/Android-Image-Cropper/issues/271)
- Need for `READ_EXTERNAL_STORAGE` permission [#271](https://github.com/CanHub/Android-Image-Cropper/issues/271)
- Previous deprecated `ActivityBuilder`, `startPickImageActivity`, `getActivityResult` and `onActivityResult` [#145](https://github.com/CanHub/Android-Image-Cropper/issues/145)
- Removed ProGuard rule from ReadMe [#257](https://github.com/CanHub/Android-Image-Cropper/issues/257)
- Removed unused dependencies and settings from Gradle files [#265](https://github.com/CanHub/Android-Image-Cropper/issues/265)

## [3.3.5] - 07/09/21
### Fixed
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ Path: `.idea/codeStyles/` Please never change anything inside this folders
- After changes you can run `./gradlew ktlintFormat` or the shortcuts in your touched files.

### General code library rules
- We do not use reflection without need, so avoid any `::` kotlint reflection without need.
- Documentation should alwways reflect the latest and best way of using the library, if is not let's fix.
- We do not use reflection without need, so avoid any `::` kotlin reflection without need.
- Documentation should always reflect the latest and best way of using the library, if is not let's fix.
- For tests we use GIVEN/WHEN/THEN pattern
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,27 @@ Only need if you run on devices under OS10 (SDK 29)

```xml
<manifest>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
</manifest>
```

### Step 4. Set source compatibility version to Java 8
### Step 4. Set source compatibility version to Java 11
- The library is up to date with the latest releases, if you are not using Java 11 yet please check the release page for previous working versions.

- Go to app level `build.gradle` file

- Add this line inside ```android``` in build.gradle (Android Gradle Plugin < 4.2)
- Add this line inside ```android``` in build.gradle
```gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
```

- This will set the java version to 8
- This expects Gradle 7.0+

# Using the Library
There is 3 ways of using the library:
Expand Down Expand Up @@ -147,7 +149,7 @@ class MainActivity {

## Extend to make a custom activity
If you want to extend the `CropImageActivity` please be aware you will need to setup your `CropImageView`
You can check a sample code in this project `com.canhub.cropper.sample.extend_activity.app.ExtendActivity`
You can check a sample code in this project `com.canhub.cropper.sample.extend_activity.app.SExtendActivity`

- Add `CropImageActivity` into your AndroidManifest.xml
```xml
Expand All @@ -162,6 +164,15 @@ override fun onCreate(savedInstanceState: Bundle?) {
}
```

### Custom dialog for image source pick
When calling crop directly the library will prompt a dialog for the user choose between gallery or camera (If you keep both enable).
We use the Android default AlertDialog for this. If you wanna customised it with your app theme you need to override the method `showImageSourceDialog(..)` when extending the activity _(above)_
```kotlin
override fun showImageSourceDialog(openSource: (Source) -> Unit) {
super.showImageSourceDialog(openCamera)
}
```

## Features
- Built-in `CropImageActivity`.
- Set cropping image as Bitmap, Resource or Android URI (Gallery, Camera, Dropbox, etc.).
Expand Down
Loading