react-native-image-crop-picker icon indicating copy to clipboard operation
react-native-image-crop-picker copied to clipboard

Cannot Click X and ✓ Buttons at the Top When Cropping in the Latest Version

Open cddceo opened this issue 8 months ago • 13 comments

Cannot Click X and ✓ Buttons at the Top When Cropping on Android with the Latest Versions of React Native and react-native-crop-picker

Image

cddceo avatar Apr 03 '25 04:04 cddceo

Same for me. Should respect the safe areas.

tapz avatar Apr 10 '25 08:04 tapz

just extend safe area from main activity

fukemy avatar Apr 11 '25 08:04 fukemy

tôi cũng gặp phải tình trạng như của bạn, tôi vẫn chưa có cách giải quyết, bạn đã có giải pháp cho trường hợp này chưa

0949328231 avatar Apr 17 '25 07:04 0949328231

Still seeing this, rendering this module completely unusable.

LightningXCE avatar Apr 21 '25 16:04 LightningXCE

i am facing the same issue

hamza-choudhary avatar Apr 23 '25 17:04 hamza-choudhary

Same issue for me as well

patilmahantesh67 avatar Apr 28 '25 12:04 patilmahantesh67

I faced similar issue as well at my latest RN project that is targeting Android SDK 35. I think this should be related to the fact that Android is forcing app targeting SDK 35 to be always edge-to-edge.

After some tinkering, the simplest way i can find to avoid this is to show the cropping activity as a floating window which will never show content under status bar/cutouts. I did so by changing the activity style for com.yalantis.ucrop.UCropActivity (from Theme.AppCompat.Light.NoActionBar) to @style/UCropTheme

AndroidManifest.xml

...
<activity
             android:name="com.yalantis.ucrop.UCropActivity"
             android:theme="@style/UCropTheme" />
...

and add the style file as following: value/styles.xml

<resources>
    <style name="UCropTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowMinWidthMajor">100%</item>
        <item name="android:windowMinWidthMinor">100%</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>

I include a patch file doing these for your convenience. So far, I am only able to test that it works for my one Android 15 phone but not other phone/Android versions, not sure if it will have any negative impact, especially on older versions of Android. Maybe someone can help to test it out?

react-native-image-crop-picker+0.42.0.patch

ahlun avatar Apr 28 '25 16:04 ahlun

I faced similar issue as well at my latest RN project that is targeting Android SDK 35. I think this should be related to the fact that Android is forcing app targeting SDK 35 to be always edge-to-edge.

After some tinkering, the simplest way i can find to avoid this is to show the cropping activity as a floating window which will never show content under status bar/cutouts. I did so by changing the activity style for com.yalantis.ucrop.UCropActivity (from Theme.AppCompat.Light.NoActionBar) to @style/UCropTheme

AndroidManifest.xml

...
<activity
             android:name="com.yalantis.ucrop.UCropActivity"
             android:theme="@style/UCropTheme" />
...

and add the style file as following: value/styles.xml

<resources>
    <style name="UCropTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowMinWidthMajor">100%</item>
        <item name="android:windowMinWidthMinor">100%</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>

I include a patch file doing these for your convenience. So far, I am only able to test that it works for my one Android 15 phone but not other phone/Android versions, not sure if it will have any negative impact, especially on older versions of Android. Maybe someone can help to test it out?

react-native-image-crop-picker+0.42.0.patch

Thanks @ahlun , your patch works correctly. Maybe you could create a PR with this.

lluisandreu avatar Apr 29 '25 05:04 lluisandreu

I faced similar issue as well at my latest RN project that is targeting Android SDK 35. I think this should be related to the fact that Android is forcing app targeting SDK 35 to be always edge-to-edge.

After some tinkering, the simplest way i can find to avoid this is to show the cropping activity as a floating window which will never show content under status bar/cutouts. I did so by changing the activity style for com.yalantis.ucrop.UCropActivity (from Theme.AppCompat.Light.NoActionBar) to @style/UCropTheme

AndroidManifest.xml

...
<activity
             android:name="com.yalantis.ucrop.UCropActivity"
             android:theme="@style/UCropTheme" />
...

and add the style file as following: value/styles.xml

<resources>
    <style name="UCropTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowMinWidthMajor">100%</item>
        <item name="android:windowMinWidthMinor">100%</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>

I include a patch file doing these for your convenience. So far, I am only able to test that it works for my one Android 15 phone but not other phone/Android versions, not sure if it will have any negative impact, especially on older versions of Android. Maybe someone can help to test it out?

react-native-image-crop-picker+0.42.0.patch

thank you very much your patch works correctly.

ahsanme avatar May 02 '25 13:05 ahsanme

Same issue latest React Native v0.79 - Android only

proton-nate avatar May 03 '25 09:05 proton-nate

I faced similar issue as well at my latest RN project that is targeting Android SDK 35. I think this should be related to the fact that Android is forcing app targeting SDK 35 to be always edge-to-edge.

After some tinkering, the simplest way i can find to avoid this is to show the cropping activity as a floating window which will never show content under status bar/cutouts. I did so by changing the activity style for com.yalantis.ucrop.UCropActivity (from Theme.AppCompat.Light.NoActionBar) to @style/UCropTheme

AndroidManifest.xml

...
<activity
             android:name="com.yalantis.ucrop.UCropActivity"
             android:theme="@style/UCropTheme" />
...

and add the style file as following: value/styles.xml

<resources>
    <style name="UCropTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowMinWidthMajor">100%</item>
        <item name="android:windowMinWidthMinor">100%</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>

I include a patch file doing these for your convenience. So far, I am only able to test that it works for my one Android 15 phone but not other phone/Android versions, not sure if it will have any negative impact, especially on older versions of Android. Maybe someone can help to test it out?

react-native-image-crop-picker+0.42.0.patch

Thanks, @ahlun — your patch works perfectly!

I encountered a strange issue where the library wasn't working on the Nothing Phone 1 running Android 15. However, it worked fine on the OnePlus 8 (Android 11) and the Docomo F-52A (Android 12).

After applying your patch, the library now works correctly across all devices.

bilalhasmie006 avatar May 05 '25 08:05 bilalhasmie006

facing the same issue in new android devices

shekhawatvivek avatar May 07 '25 04:05 shekhawatvivek

I faced similar issue as well at my latest RN project that is targeting Android SDK 35. I think this should be related to the fact that Android is forcing app targeting SDK 35 to be always edge-to-edge.

After some tinkering, the simplest way i can find to avoid this is to show the cropping activity as a floating window which will never show content under status bar/cutouts. I did so by changing the activity style for com.yalantis.ucrop.UCropActivity (from Theme.AppCompat.Light.NoActionBar) to @style/UCropTheme

AndroidManifest.xml

...
<activity
             android:name="com.yalantis.ucrop.UCropActivity"
             android:theme="@style/UCropTheme" />
...

and add the style file as following: value/styles.xml

<resources>
    <style name="UCropTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowIsFloating">true</item>
        <item name="android:windowMinWidthMajor">100%</item>
        <item name="android:windowMinWidthMinor">100%</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>
</resources>

I include a patch file doing these for your convenience. So far, I am only able to test that it works for my one Android 15 phone but not other phone/Android versions, not sure if it will have any negative impact, especially on older versions of Android. Maybe someone can help to test it out?

react-native-image-crop-picker+0.42.0.patch

Thanks @ahlun, it worked for me

anand-bijliride avatar Jul 17 '25 08:07 anand-bijliride