Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into deeplink_crash
Browse files Browse the repository at this point in the history
  • Loading branch information
fmatosqg committed May 19, 2020
2 parents ad439e0 + 22d10ba commit 4c17135
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ pubspec.lock
build/
flutter_export_environment.sh

////////////
######################
.idea/
*.iml
64 changes: 18 additions & 46 deletions .idea/markdown-navigator.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.2.2] - 2020-05-12

* Android: upgrade uCrop to v2.2.5
* **BREAKING CHANGE**: remove `activeWidgetColor` from `AndroidUiSettings`

## [1.2.1] - 2020-02-01

* iOS: add more UI customization properties (title, initRect)
Expand Down
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,26 +82,25 @@ The result file is saved in `NSTemporaryDirectory` on iOS and application Cache

**Image Cropper** provides a helper class called `AndroidUiSettings` that wraps all properties can be used to customize UI in **uCrop** library.

| Property | Description | Type |
|-----------------------------|---------------------------------------------------------------------------------------------------------|-----------------------|
| `toolbarTitle` | desired text for Toolbar title | String |
| `toolbarColor` | desired color of the Toolbar | Color |
| `statusBarColor` | desired color of status | Color |
| `toolbarWidgetColor` | desired color of Toolbar text and buttons (default is darker orange) | Color |
| `backgroundColor` | desired background color that should be applied to the root view | Color |
| `activeControlsWidgetColor` | desired color of the active and selected widget (default is white) | Color |
| `activeWidgetColor` | desired color of the progress wheel middle line (default is violet) | Color |
| `dimmedLayerColor` | desired color of dimmed area around the crop bounds | Color |
| `cropFrameColor` | desired color of crop frame | Color |
| `cropGridColor` | desired color of crop grid/guidelines | Color |
| `cropFrameStrokeWidth` | desired width of crop frame line in pixels | int |
| `cropGridRowCount` | crop grid rows count | int |
| `cropGridColumnCount` | crop grid columns count | int |
| `cropGridStrokeWidth` | desired width of crop grid lines in pixels | int |
| `showCropGrid` | set to true if you want to see a crop grid/guidelines on top of an image | bool |
| `lockAspectRatio` | set to true if you want to lock the aspect ratio of crop bounds with a fixed value (locked by default) | bool |
| `hideBottomControls` | set to true to hide the bottom controls (shown by default) | bool |
| `initAspectRatio` | desired aspect ratio is applied (from the list of given aspect ratio presets) when starting the cropper | CropAspectRatioPreset |
| Property | Description | Type |
|-----------------------------|-------------------------------------------------------------------------------------------------------------|-----------------------|
| `toolbarTitle` | desired text for Toolbar title | String |
| `toolbarColor` | desired color of the Toolbar | Color |
| `statusBarColor` | desired color of status | Color |
| `toolbarWidgetColor` | desired color of Toolbar text and buttons (default is darker orange) | Color |
| `backgroundColor` | desired background color that should be applied to the root view | Color |
| `activeControlsWidgetColor` | desired resolved color of the active and selected widget and progress wheel middle line (default is white) | Color |
| `dimmedLayerColor` | desired color of dimmed area around the crop bounds | Color |
| `cropFrameColor` | desired color of crop frame | Color |
| `cropGridColor` | desired color of crop grid/guidelines | Color |
| `cropFrameStrokeWidth` | desired width of crop frame line in pixels | int |
| `cropGridRowCount` | crop grid rows count | int |
| `cropGridColumnCount` | crop grid columns count | int |
| `cropGridStrokeWidth` | desired width of crop grid lines in pixels | int |
| `showCropGrid` | set to true if you want to see a crop grid/guidelines on top of an image | bool |
| `lockAspectRatio` | set to true if you want to lock the aspect ratio of crop bounds with a fixed value (locked by default) | bool |
| `hideBottomControls` | set to true to hide the bottom controls (shown by default) | bool |
| `initAspectRatio` | desired aspect ratio is applied (from the list of given aspect ratio presets) when starting the cropper | CropAspectRatioPreset |


### iOS
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:3.6.3'
}
}

Expand All @@ -34,6 +34,6 @@ android {
disable 'InvalidPackage'
}
dependencies {
implementation 'com.github.yalantis:ucrop:2.2.4'
implementation 'com.github.yalantis:ucrop:2.2.5'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ private UCrop.Options setupUiCustomizedOptions(UCrop.Options options, MethodCall
Integer toolbarWidgetColor = call.argument("android.toolbar_widget_color");
Integer backgroundColor = call.argument("android.background_color");
Integer activeControlsWidgetColor = call.argument("android.active_controls_widget_color");
Integer activeWidgetColor = call.argument("android.active_widget_color");
Integer dimmedLayerColor = call.argument("android.dimmed_layer_color");
Integer cropFrameColor = call.argument("android.crop_frame_color");
Integer cropGridColor = call.argument("android.crop_grid_color");
Expand Down Expand Up @@ -159,9 +158,6 @@ private UCrop.Options setupUiCustomizedOptions(UCrop.Options options, MethodCall
if (activeControlsWidgetColor != null) {
options.setActiveControlsWidgetColor(activeControlsWidgetColor);
}
if (activeWidgetColor != null) {
options.setActiveWidgetColor(activeWidgetColor);
}
if (dimmedLayerColor != null) {
options.setDimmedLayerColor(dimmedLayerColor);
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.6.3'
}
}

Expand Down
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Fri Jun 23 08:50:38 CEST 2017
#Tue May 12 14:18:32 ICT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
57 changes: 28 additions & 29 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,35 +90,34 @@ class _MyHomePageState extends State<MyHomePage> {

Future<Null> _cropImage() async {
File croppedFile = await ImageCropper.cropImage(
sourcePath: imageFile.path,
aspectRatioPresets: Platform.isAndroid
? [
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.original,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio16x9
]
: [
CropAspectRatioPreset.original,
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio5x3,
CropAspectRatioPreset.ratio5x4,
CropAspectRatioPreset.ratio7x5,
CropAspectRatioPreset.ratio16x9
],
androidUiSettings: AndroidUiSettings(
toolbarTitle: 'Cropper',
toolbarColor: Colors.deepOrange,
toolbarWidgetColor: Colors.white,
initAspectRatio: CropAspectRatioPreset.original,
lockAspectRatio: false),
iosUiSettings: IOSUiSettings(
title: 'Cropper',
)
);
sourcePath: imageFile.path,
aspectRatioPresets: Platform.isAndroid
? [
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.original,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio16x9
]
: [
CropAspectRatioPreset.original,
CropAspectRatioPreset.square,
CropAspectRatioPreset.ratio3x2,
CropAspectRatioPreset.ratio4x3,
CropAspectRatioPreset.ratio5x3,
CropAspectRatioPreset.ratio5x4,
CropAspectRatioPreset.ratio7x5,
CropAspectRatioPreset.ratio16x9
],
androidUiSettings: AndroidUiSettings(
toolbarTitle: 'Cropper',
toolbarColor: Colors.deepOrange,
toolbarWidgetColor: Colors.white,
initAspectRatio: CropAspectRatioPreset.original,
lockAspectRatio: false),
iosUiSettings: IOSUiSettings(
title: 'Cropper',
));
if (croppedFile != null) {
imageFile = croppedFile;
setState(() {
Expand Down
Loading

0 comments on commit 4c17135

Please sign in to comment.