From fb12c049e3bd619dbbab00c21888e3c31021bf88 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Mon, 18 Dec 2023 17:56:09 +0100 Subject: [PATCH 1/2] refactor(android)!: Unify gallery cancel message (#1967) --- .../com/capacitorjs/plugins/camera/CameraPlugin.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java index 24a1aec02..2dce20da1 100644 --- a/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java +++ b/camera/android/src/main/java/com/capacitorjs/plugins/camera/CameraPlugin.java @@ -51,7 +51,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.UUID; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import java.util.concurrent.atomic.AtomicInteger; @@ -104,6 +103,7 @@ public class CameraPlugin extends Plugin { private static final String UNABLE_TO_PROCESS_IMAGE = "Unable to process image"; private static final String IMAGE_EDIT_ERROR = "Unable to edit image"; private static final String IMAGE_GALLERY_SAVE_ERROR = "Unable to save the image in the gallery"; + private static final String USER_CANCELLED = "User cancelled photos app"; private String imageFileSavePath; private String imageEditedFileSavePath; @@ -180,7 +180,7 @@ private void showPrompt(final PluginCall call) { openCamera(call); } }, - () -> call.reject("User cancelled photos app") + () -> call.reject(USER_CANCELLED) ); fragment.show(getActivity().getSupportFragmentManager(), "capacitorModalsActionSheet"); } @@ -376,7 +376,7 @@ private void openPhotos(final PluginCall call, boolean multiple) { } ); } else { - call.reject("No images picked"); + call.reject(USER_CANCELLED); } pickMultipleMedia.unregister(); } @@ -393,7 +393,7 @@ private void openPhotos(final PluginCall call, boolean multiple) { imagePickedContentUri = uri; processPickedImage(uri, call); } else { - call.reject("No image picked"); + call.reject(USER_CANCELLED); } pickMedia.unregister(); } @@ -421,7 +421,7 @@ public void processCameraImage(PluginCall call, ActivityResult result) { Bitmap bitmap = BitmapFactory.decodeFile(imageFileSavePath, bmOptions); if (bitmap == null) { - call.reject("User cancelled photos app"); + call.reject(USER_CANCELLED); return; } @@ -432,7 +432,7 @@ public void processPickedImage(PluginCall call, ActivityResult result) { settings = getSettings(call); Intent data = result.getData(); if (data == null) { - call.reject("No image picked"); + call.reject(USER_CANCELLED); return; } From 2050a485b4ac32b6ea06728a42c46a7e68989d54 Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Thu, 21 Dec 2023 10:54:11 +0100 Subject: [PATCH 2/2] chore(android): Update default value of androidxCoreVersion (#1973) --- share/android/build.gradle | 2 +- status-bar/android/build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/share/android/build.gradle b/share/android/build.gradle index bb190f497..07b3826af 100644 --- a/share/android/build.gradle +++ b/share/android/build.gradle @@ -2,7 +2,7 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.10.1' + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.12.0' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1' } diff --git a/status-bar/android/build.gradle b/status-bar/android/build.gradle index 3ebd7168c..faa47d72b 100644 --- a/status-bar/android/build.gradle +++ b/status-bar/android/build.gradle @@ -1,7 +1,7 @@ ext { capacitorVersion = System.getenv('CAPACITOR_VERSION') junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2' - androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.10.1' + androidxCoreVersion = project.hasProperty('androidxCoreVersion') ? rootProject.ext.androidxCoreVersion : '1.12.0' androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1' androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5' androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'