Skip to content

Commit 1f892e4

Browse files
authored
API: Deprecate CropImageActivity. (#635)
1 parent e5424e9 commit 1f892e4

5 files changed

Lines changed: 14 additions & 0 deletions

File tree

cropper/src/main/kotlin/com/canhub/cropper/CropImageActivity.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ import com.canhub.cropper.databinding.CropImageActivityBinding
2929
import com.canhub.cropper.utils.getUriForFile
3030
import java.io.File
3131

32+
@Deprecated(
33+
message = """
34+
Create your own Activity and use the CropImageView directly.
35+
This way you can customize everything and have utter control of everything.
36+
Feel free to use this Activity Code to create your own Activity.
37+
""",
38+
)
3239
open class CropImageActivity :
3340
AppCompatActivity(),
3441
OnSetImageUriCompleteListener,

cropper/src/main/kotlin/com/canhub/cropper/CropImageContract.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.activity.result.contract.ActivityResultContract
1212
* If you do not provide an [CropImageContractOptions.uri] in the input the user will be asked to pick an image before cropping.
1313
*/
1414
class CropImageContract : ActivityResultContract<CropImageContractOptions, CropImageView.CropResult>() {
15+
@Suppress("DEPRECATION")
1516
override fun createIntent(context: Context, input: CropImageContractOptions) = Intent(context, CropImageActivity::class.java).apply {
1617
putExtra(
1718
CropImage.CROP_IMAGE_EXTRA_BUNDLE,

cropper/src/test/kotlin/com/canhub/cropper/CropImageContractTest.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("DEPRECATION")
2+
13
package com.canhub.cropper
24

35
import android.app.Activity

sample/src/main/kotlin/com/canhub/cropper/sample/SampleCropFragment.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("DEPRECATION")
2+
13
package com.canhub.cropper.sample
24

35
import android.net.Uri

sample/src/main/kotlin/com/canhub/cropper/sample/SampleCustomActivity.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("DEPRECATION")
2+
13
package com.canhub.cropper.sample
24

35
import android.app.Activity

0 commit comments

Comments
 (0)