Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

add sharing message text for customer profile #141

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,6 +51,7 @@ public class CustomerProfileActivity extends FineractBaseActivity
CoordinatorLayout errorView;

private String customerIdentifier;
private Customer customer;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -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();
Expand Down Expand Up @@ -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)));
}
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/java/org/apache/fineract/utils/ConstantKeys.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
}