From 71025a65f9232ae7175c0f1e593ab8d330243a6d Mon Sep 17 00:00:00 2001 From: PatelVatsalB21 Date: Wed, 17 Mar 2021 18:23:43 +0530 Subject: [PATCH] fix 287: Photo validation added in EditCustomerProfileBottomSheet --- .../EditCustomerProfileBottomSheet.java | 4 ++++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/editcustomerprofilebottomsheet/EditCustomerProfileBottomSheet.java b/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/editcustomerprofilebottomsheet/EditCustomerProfileBottomSheet.java index 77ee5c9c..c2f6d4f0 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/editcustomerprofilebottomsheet/EditCustomerProfileBottomSheet.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/editcustomerprofilebottomsheet/EditCustomerProfileBottomSheet.java @@ -286,6 +286,10 @@ void onCancel() { @OnClick(R.id.btn_upload_photo) void uploadPhoto() { if (editAction == EditAction.CAMERA || editAction == EditAction.GALLERY) { + if (file == null) { + Toaster.show(rootView, getString(R.string.select_photo)); + return; + } editCustomerProfilePresenter.uploadCustomerPortrait(customerIdentifier, file); } else if (editAction == EditAction.DELETE) { editCustomerProfilePresenter.deleteCustomerPortrait(customerIdentifier); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index af22aaa1..b3786122 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -176,6 +176,7 @@ Portrait uploaded successfully Portrait deleted successfully Portrait can\'t exceed size of 512KB. + Please select photo to upload Customer deposit account %1$s created successfully %1$s updated successfully