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

[Android] Initial selection

Open sn4f opened this issue 3 years ago • 4 comments

Hello, thanks for the package! Is it possible to set 100% width of the cropping area on init? On iOS it's fine

sn4f avatar May 17 '22 22:05 sn4f

Hello, the same on android... And the image works in the resizeMode="contain" mode, while ios, on the contrary, "cover"

dudkevych avatar Jun 14 '22 12:06 dudkevych

You can edit library file here: Search file: ImageCropViewManager.kt

@ReactProp(name = SOURCE_URL_PROP)
fun setSourceUrl(view: CropImageView, url: String?) {
    url?.let {
        view.setImageUriAsync(Uri.parse(it))
        view.setMinCropResultSize(10000, 10000);
        Timer().schedule(2000) {
            view.setMinCropResultSize(0, 0);
        }

    }
}

phongnguyenmaster avatar Feb 04 '23 21:02 phongnguyenmaster

@ReactProp(name = SOURCE_URL_PROP)
fun setSourceUrl(view: CropImageView, url: String?) {
    url?.let {
        view.setImageUriAsync(Uri.parse(it))
        view.setMinCropResultSize(10000, 10000);
        Timer().schedule(object : TimerTask() {
            override fun run() {
                view.setMinCropResultSize(0, 0)
            }
        }, 2000)
    }
}

liuyanhang2004 avatar May 28 '23 14:05 liuyanhang2004

How to implement this? Editing native code is not good idea

Gabotron-ES avatar Feb 02 '24 00:02 Gabotron-ES