Yalantis / uCrop

Image Cropping Library for Android
https://yalantis.com/blog/introducing-ucrop-our-own-image-cropping-library-for-android/
11.88k stars 2.16k forks source link

In kotlin onActivityResult, This method has been deprecated #921

Open chinhdl891 opened 3 months ago

chinhdl891 commented 3 months ago

@Deprecated("This method has been deprecated in favor of using the Activity Result API\n " + " which brings increased type safety via an {@link ActivityResultContract} and the prebuilt\n" + " contracts for common intents available in\n " + " {@link androidx.activity.result.contract.ActivityResultContracts}, provides hooks for\n " + " testing, and allow receiving results in separate, testable classes independent from your\n " + " activity. Use\n {@link #registerForActivityResult(ActivityResultContract, ActivityResultCallback)}\n " + " with the appropriate {@link ActivityResultContract} and handling the result in the\n " + " {@link ActivityResultCallback#onActivityResult(Object) callback}.")

jens-muenker commented 3 weeks ago

I made a fork which replaced it with an ActivityResultLauncher. In addition to the small updates, I translated most of the code to kotlin.