Skip to content

Commit 013f14d

Browse files
authored
Update uCrop to 2.2.11 to resolve Android edge-to-edge(notch) issue (#2187)
* Revert "Notch Issue Fix 08-05-2025 (#2168)" This reverts commit 3d5776c. * Update uCrop to 2.2.11 and sync changes `cropperStatusBarColor` removed, added `cropperStatusBarLight` and `cropperNavigationBarLight`
1 parent 3d5776c commit 013f14d

File tree

8 files changed

+67
-64
lines changed

8 files changed

+67
-64
lines changed

AwesomeExample/App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ export default class App extends Component<{}, AppState> {
175175
compressImageQuality: 1,
176176
compressVideoPreset: 'MediumQuality',
177177
includeExif: true,
178-
cropperStatusBarColor: 'white',
178+
cropperStatusBarLight: true,
179+
cropperNavigationBarLight: false,
179180
cropperToolbarColor: 'white',
180181
cropperActiveWidgetColor: 'white',
181182
cropperToolbarWidgetColor: '#3498DB',

README.md

Lines changed: 43 additions & 42 deletions
Large diffs are not rendered by default.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ dependencies {
9999
}
100100
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
101101
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
102-
implementation 'com.github.yalantis:ucrop:2.2.10'
102+
implementation 'com.github.yalantis:ucrop:2.2.11'
103103
implementation 'androidx.activity:activity:1.10.1'
104104
implementation "androidx.core:core:1.16.0"
105105
implementation 'androidx.exifinterface:exifinterface:1.4.1'

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<activity
2626
android:name="com.yalantis.ucrop.UCropActivity"
27-
android:theme="@style/UCropTheme"
27+
android:theme="@style/Theme.AppCompat.Light.NoActionBar"
2828
android:exported="false" />
2929

3030

android/src/main/java/com/reactnative/ivpusic/imagepicker/ImageCropPicker.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.facebook.react.bridge.Promise;
3030
import com.facebook.react.bridge.PromiseImpl;
3131
import com.facebook.react.bridge.ReactApplicationContext;
32-
import com.facebook.react.bridge.ReactMethod;
3332
import com.facebook.react.bridge.ReadableMap;
3433
import com.facebook.react.bridge.WritableMap;
3534
import com.facebook.react.bridge.WritableNativeMap;
@@ -91,10 +90,11 @@ class ImageCropPicker implements ActivityEventListener {
9190
private boolean enableRotationGesture = false;
9291
private boolean disableCropperColorSetters = false;
9392
private boolean useFrontCamera = false;
93+
private boolean cropperStatusBarLight = true;
94+
private boolean cropperNavigationBarLight = false;
9495
private ReadableMap options;
9596

9697
private String cropperActiveWidgetColor = null;
97-
private String cropperStatusBarColor = null;
9898
private String cropperToolbarColor = null;
9999
private String cropperToolbarTitle = null;
100100
private String cropperToolbarWidgetColor = null;
@@ -132,7 +132,6 @@ private void setConfiguration(final ReadableMap options) {
132132
maxFiles = options.hasKey("maxFiles") ? options.getInt("maxFiles") : maxFiles;
133133
cropping = options.hasKey("cropping") && options.getBoolean("cropping");
134134
cropperActiveWidgetColor = options.hasKey("cropperActiveWidgetColor") ? options.getString("cropperActiveWidgetColor") : null;
135-
cropperStatusBarColor = options.hasKey("cropperStatusBarColor") ? options.getString("cropperStatusBarColor") : null;
136135
cropperToolbarColor = options.hasKey("cropperToolbarColor") ? options.getString("cropperToolbarColor") : null;
137136
cropperToolbarTitle = options.hasKey("cropperToolbarTitle") ? options.getString("cropperToolbarTitle") : null;
138137
cropperToolbarWidgetColor = options.hasKey("cropperToolbarWidgetColor") ? options.getString("cropperToolbarWidgetColor") : null;
@@ -144,6 +143,8 @@ private void setConfiguration(final ReadableMap options) {
144143
enableRotationGesture = options.hasKey("enableRotationGesture") && options.getBoolean("enableRotationGesture");
145144
disableCropperColorSetters = options.hasKey("disableCropperColorSetters") && options.getBoolean("disableCropperColorSetters");
146145
useFrontCamera = options.hasKey("useFrontCamera") && options.getBoolean("useFrontCamera");
146+
cropperStatusBarLight = options.hasKey("cropperStatusBarLight") ? options.getBoolean("cropperStatusBarLight") : true;
147+
cropperNavigationBarLight = options.hasKey("cropperNavigationBarLight") ? options.getBoolean("cropperNavigationBarLight") : false;
147148
this.options = options;
148149
}
149150

@@ -704,13 +705,12 @@ private void configureCropperColors(UCrop.Options options) {
704705
options.setToolbarColor(Color.parseColor(cropperToolbarColor));
705706
}
706707

707-
if (cropperStatusBarColor != null) {
708-
options.setStatusBarColor(Color.parseColor(cropperStatusBarColor));
709-
}
710-
711708
if (cropperToolbarWidgetColor != null) {
712709
options.setToolbarWidgetColor(Color.parseColor(cropperToolbarWidgetColor));
713710
}
711+
712+
options.setStatusBarLight(cropperStatusBarLight);
713+
options.setNavigationBarLight(cropperNavigationBarLight);
714714
}
715715

716716
private void startCropping(final Activity activity, final Uri uri) {

android/src/main/res/values/styles.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

index.d.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,20 @@ declare module "react-native-image-crop-picker" {
198198
cropperActiveWidgetColor?: string;
199199

200200
/**
201-
* When cropping image, determines the color of StatusBar.
201+
* When cropping image, true for light status bar (dark icons), false for dark status bar (light icons).
202202
*
203203
* @platform Android only
204-
* @default '#424242'
204+
* @default true
205+
*/
206+
cropperStatusBarLight?: boolean;
207+
208+
/**
209+
* When cropping image, true for light navigation bar (dark icons), false for dark navigation bar (light icons).
210+
*
211+
* @platform Android only
212+
* @default false
205213
*/
206-
cropperStatusBarColor?: string;
214+
cropperNavigationBarLight?: boolean;
207215

208216
/**
209217
* When cropping image, determines the color of Toolbar.

src/NativeImageCropPicker.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export type PickerOptions = {
3333
width?: number;
3434
height?: number;
3535
cropperActiveWidgetColor?: string;
36-
cropperStatusBarColor?: string;
36+
cropperStatusBarLight?: boolean;
37+
cropperNavigationBarLight?: boolean;
3738
cropperToolbarColor?: string;
3839
cropperToolbarTitle?: string;
3940
cropperToolbarWidgetColor?: string;

0 commit comments

Comments
 (0)