From f1065dc025eaf5a3db56e371e739c461541b2fce Mon Sep 17 00:00:00 2001 From: Niklas Baudy Date: Mon, 5 Aug 2024 11:24:52 +0200 Subject: [PATCH] API: Deprecate CropImageActivity. --- .../src/main/kotlin/com/canhub/cropper/CropImageActivity.kt | 5 +++++ .../src/main/kotlin/com/canhub/cropper/CropImageContract.kt | 1 + .../kotlin/com/canhub/cropper/sample/SampleCropFragment.kt | 2 ++ .../kotlin/com/canhub/cropper/sample/SampleCustomActivity.kt | 2 ++ 4 files changed, 10 insertions(+) diff --git a/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt b/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt index 1c7ca52f..0ebb797d 100644 --- a/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt +++ b/cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt @@ -29,6 +29,11 @@ import com.canhub.cropper.databinding.CropImageActivityBinding import com.canhub.cropper.utils.getUriForFile import java.io.File +@Deprecated(message = """ + Create your own Activity and use the CropImageView directly. + This way you can customize everything and have utter control of everything. + Feel free to use this Activity Code to create your own Activity. +""") open class CropImageActivity : AppCompatActivity(), OnSetImageUriCompleteListener, diff --git a/cropper/src/main/kotlin/com/canhub/cropper/CropImageContract.kt b/cropper/src/main/kotlin/com/canhub/cropper/CropImageContract.kt index 32360dc8..ecb16711 100644 --- a/cropper/src/main/kotlin/com/canhub/cropper/CropImageContract.kt +++ b/cropper/src/main/kotlin/com/canhub/cropper/CropImageContract.kt @@ -12,6 +12,7 @@ import androidx.activity.result.contract.ActivityResultContract * If you do not provide an [CropImageContractOptions.uri] in the input the user will be asked to pick an image before cropping. */ class CropImageContract : ActivityResultContract() { + @Suppress("DEPRECATION") override fun createIntent(context: Context, input: CropImageContractOptions) = Intent(context, CropImageActivity::class.java).apply { putExtra( CropImage.CROP_IMAGE_EXTRA_BUNDLE, diff --git a/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCropFragment.kt b/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCropFragment.kt index b3084e74..78e6a5e8 100644 --- a/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCropFragment.kt +++ b/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCropFragment.kt @@ -1,3 +1,5 @@ +@file:Suppress("DEPRECATION") + package com.canhub.cropper.sample import android.net.Uri diff --git a/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCustomActivity.kt b/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCustomActivity.kt index 28bb2474..3c40329b 100644 --- a/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCustomActivity.kt +++ b/sample/src/main/kotlin/com/canhub/cropper/sample/SampleCustomActivity.kt @@ -1,3 +1,5 @@ +@file:Suppress("DEPRECATION") + package com.canhub.cropper.sample import android.app.Activity