hhunaid / react-native-image-crop-tools

Native-ish Image Crop Tools for react native
171 stars 58 forks source link

[Android] Initial selection #67

Open sn4f opened 2 years ago

sn4f commented 2 years ago

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

dudkevych commented 2 years ago

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

phongnguyenmaster commented 1 year ago

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);
        }

    }
}
liuyanhang2004 commented 1 year ago
@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)
    }
}
Gabotron-ES commented 7 months ago

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