From db27258c1803c3b2d06ee69dd20e1d2150461f94 Mon Sep 17 00:00:00 2001 From: kosyak Date: Mon, 18 Dec 2023 04:24:49 +0100 Subject: [PATCH] fix crop lib compatibility issues --- build.gradle | 3 +-- .../siacs/conversations/medialib/activities/EditActivity.kt | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 236168cd6..dd955aa8a 100644 --- a/build.gradle +++ b/build.gradle @@ -47,7 +47,7 @@ dependencies { conversationsPlaystoreImplementation("com.android.installreferrer:installreferrer:2.2") quicksyPlaystoreImplementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1' implementation 'com.github.open-keychain.open-keychain:openpgp-api:v5.7.1' - implementation("com.github.CanHub:Android-Image-Cropper:2.0.0") + implementation("com.github.CanHub:Android-Image-Cropper:2.2.0") implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.exifinterface:exifinterface:1.3.6' implementation 'androidx.cardview:cardview:1.0.0' @@ -99,7 +99,6 @@ dependencies { implementation 'com.github.kizitonwose.colorpreference:support:1.1.0' implementation 'com.caverock:androidsvg-aar:1.4' implementation 'com.github.singpolyma:Better-Link-Movement-Method:4df081e1e4' - implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0' } ext { diff --git a/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt b/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt index e0b70e277..83a21498b 100644 --- a/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt +++ b/src/main/java/eu/siacs/conversations/medialib/activities/EditActivity.kt @@ -23,8 +23,8 @@ import com.bumptech.glide.load.engine.GlideException import com.bumptech.glide.request.RequestListener import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.request.target.Target +import com.canhub.cropper.CropImageView import com.leinardi.android.speeddial.UiUtils.getPrimaryColor -import com.theartofdev.edmodo.cropper.CropImageView import com.zomato.photofilters.FilterPack import com.zomato.photofilters.imageprocessors.Filter import eu.siacs.conversations.R @@ -663,11 +663,11 @@ class EditActivity : AppCompatActivity(), CropImageView.OnCropImageCompleteListe if (result.error == null) { setOldExif() - val bitmap = result.bitmap + val bitmap = result.bitmap ?: return saveBitmapToFile(bitmap, true) } else { - toast("${getString(R.string.image_editing_failed)}: ${result.error.message}") + toast("${getString(R.string.image_editing_failed)}: ${result.error?.message}") } }