diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java b/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java index b34f58e1..d0591ce1 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerdetails/CustomerDetailsFragment.java @@ -194,6 +194,7 @@ void showIdentificationCards() { void showCustomerProfileImage() { Intent intent = new Intent(getActivity(), CustomerProfileActivity.class); intent.putExtra(ConstantKeys.CUSTOMER_IDENTIFIER, customerIdentifier); + intent.putExtra(ConstantKeys.CUSTOMER, customer); startActivity(intent); } diff --git a/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/CustomerProfileActivity.java b/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/CustomerProfileActivity.java index b31078cb..43755a36 100644 --- a/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/CustomerProfileActivity.java +++ b/app/src/main/java/org/apache/fineract/ui/online/customers/customerprofile/CustomerProfileActivity.java @@ -21,6 +21,7 @@ import com.github.therajanmaurya.sweeterror.SweetUIErrorHandler; import org.apache.fineract.R; +import org.apache.fineract.data.models.customer.Customer; import org.apache.fineract.ui.base.FineractBaseActivity; import org.apache.fineract.ui.base.Toaster; import org.apache.fineract.ui.online.customers.customerprofile.editcustomerprofilebottomsheet @@ -50,6 +51,7 @@ public class CustomerProfileActivity extends FineractBaseActivity CoordinatorLayout errorView; private String customerIdentifier; + private Customer customer; @Override protected void onCreate(Bundle savedInstanceState) { @@ -58,6 +60,7 @@ protected void onCreate(Bundle savedInstanceState) { ButterKnife.bind(this); customerIdentifier = getIntent().getExtras().getString(ConstantKeys.CUSTOMER_IDENTIFIER); + customer = getIntent().getExtras().getParcelable(ConstantKeys.CUSTOMER); sweetUIErrorHandler = new SweetUIErrorHandler(this, findViewById(android.R.id.content)); loadCustomerPortrait(); @@ -93,10 +96,14 @@ public boolean onOptionsItemSelected(MenuItem item) { } public void shareImage() { + String shareMsgBody = ConstantKeys.PROFILE_SHARING_TEXT_START + + customer.getGivenName() + " " + customer.getSurname() + + ConstantKeys.PROFILE_SHARING_TEXT_END; Uri bitmapUri = getImageUri(this, getBitmapFromView(ivCustomerProfile)); Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("image/jpg"); shareIntent.putExtra(Intent.EXTRA_STREAM, bitmapUri); + shareIntent.putExtra(Intent.EXTRA_TEXT, shareMsgBody); startActivity(Intent.createChooser(shareIntent, getString(R.string.share_customer_profile))); } diff --git a/app/src/main/java/org/apache/fineract/utils/ConstantKeys.java b/app/src/main/java/org/apache/fineract/utils/ConstantKeys.java index 028076b8..fe8ef849 100644 --- a/app/src/main/java/org/apache/fineract/utils/ConstantKeys.java +++ b/app/src/main/java/org/apache/fineract/utils/ConstantKeys.java @@ -40,4 +40,7 @@ public class ConstantKeys { public static final int PERMISSION_REQUEST_READ_EXTERNAL_STORAGE = 3; public static final String PERMISSIONS_READ_EXTERNAL_STORAGE_STATUS = "read_status"; + public static final String PROFILE_SHARING_TEXT_START = + "Hey there, here's the profile of a customer "; + public static final String PROFILE_SHARING_TEXT_END = " shared with you from fineract mobile."; }