Browse Source

Number and fb link mapped to user country code

master
Preyea Regmi 5 years ago
parent
commit
c7de2cc3bd
  1. 76
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customer_support/view/CustomerSupportFragment.java
  2. 42
      app/src/main/java/com/gmeremit/online/gmeremittance_native/static_pages/view/AboutGME.java

76
app/src/main/java/com/gmeremit/online/gmeremittance_native/customer_support/view/CustomerSupportFragment.java

@ -7,6 +7,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.DialogFragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
@ -29,6 +30,8 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_COOUNTRY_CODE;
/**
* Created by FMI-LT-17 on 2/6/2018.
*/
@ -75,42 +78,47 @@ public class CustomerSupportFragment extends DialogFragment implements CustomerS
private void performDefaultAction() {
List<CustomerSupportContact> contactList = getCustomerSupportContact();
CustomerSupportContact selectedContact = null;
String preferredCountry = GmeApplication.getPreferredCountryCode();
for (CustomerSupportContact contact : contactList) {
if (contact.getCountryCode().equalsIgnoreCase(preferredCountry)) {
selectedContact = contact;
break;
}
}
if (selectedContact == null)
selectedContact = contactList.get(0);
callTxtView.setText(selectedContact.getCustomerContact());
callTxtView.setText(getCustomerSupportContact());
}
private String getCustomerSupportContact() {
String localeCode = GmeApplication.getStorage().getString(USER_COOUNTRY_CODE, "NP");
Log.d("CurrentUserNativeCode", localeCode);
switch (localeCode.toUpperCase()) {
case "KH":
return "1811-2941";
case "TH":
return "010-9928-6864";
case "LK":
return "1811-2935";
case "MN":
return "010-2973-6864";
case "MM":
return "1811-2938";
case "NP":
return "1811-2934";
case "ID":
return "1811-2945";
case "BD":
return "1811-2943";
case "UZ":
return "010-3015-6864";
case "VN":
return "1811-2937";
case "PH":
return "1811-2936";
case "IN":
return "010-2760-6864";
case "PK":
return "010-2760-6864";
default:
return "1811-2934";
}
private List<CustomerSupportContact> getCustomerSupportContact() {
List<CustomerSupportContact> contactList = new ArrayList<>();
contactList.add(new CustomerSupportContact("EN", "1811-2934"));
contactList.add(new CustomerSupportContact("KH", "1811-2941"));
contactList.add(new CustomerSupportContact("KR", "1811-2934"));
contactList.add(new CustomerSupportContact("TH", "010-9928-6864"));
contactList.add(new CustomerSupportContact("LK", "1811-2935"));
contactList.add(new CustomerSupportContact("MN", "010-2973-6864"));
contactList.add(new CustomerSupportContact("MM", "1811-2938"));
contactList.add(new CustomerSupportContact("NP", "1811-2934"));
contactList.add(new CustomerSupportContact("ID", "1811-2945"));
contactList.add(new CustomerSupportContact("BD", "1811-2943"));
contactList.add(new CustomerSupportContact("RU", "010-3015-6864"));
contactList.add(new CustomerSupportContact("UZ", "010-3015-6864"));
contactList.add(new CustomerSupportContact("VN", "1811-2937"));
return contactList;
}
private void init(View view) {

42
app/src/main/java/com/gmeremit/online/gmeremittance_native/static_pages/view/AboutGME.java

@ -9,6 +9,7 @@ import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
@ -16,6 +17,7 @@ import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.BuildConfig;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.base.PrefKeys;
import com.gmeremit.online.gmeremittance_native.static_pages.StaticPagesContract;
import com.gmeremit.online.gmeremittance_native.static_pages.presenter.StaticPagesPresenter;
import com.gmeremit.online.gmeremittance_native.utils.Constants;
@ -27,6 +29,7 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_COOUNTRY_CODE;
import static com.gmeremit.online.gmeremittance_native.base.PrefKeys.USER_PREFERRED_LOCALE;
import static com.gmeremit.online.gmeremittance_native.utils.Constants.FACEBOOK;
import static com.gmeremit.online.gmeremittance_native.utils.Constants.LINKEDIN;
@ -159,35 +162,38 @@ public class AboutGME extends AppCompatActivity implements StaticPagesContract.I
public String getFacebookUri() {
String localeCode = GmeApplication.getStorage().getString(USER_PREFERRED_LOCALE, "en");
String localeCode = GmeApplication.getStorage().getString(USER_COOUNTRY_CODE, "NP");
Log.d("CurrentUserNativeCode",localeCode);
switch (localeCode.toUpperCase()) {
switch (localeCode) {
case "en":
return "https://www.facebook.com/gmenepal/?ref=br_rs";
case "km":
case "KH":
return "https://www.facebook.com/gmecambodia/?ref=br_rs";
case "ko":
return "https://www.facebook.com/gmenepal/?ref=br_rs";
case "th":
case "TH":
return "https://www.facebook.com/gmethailand/?ref=br_rs";
case "ta":
case "LK":
return "https://www.facebook.com/gmeremitsrilanka/?ref=br_rs";
case "mn":
return "https://www.facebook.com/GME-Remittance-Myanmar-295378281070768/?ref=br_rs";
case "my":
case "MN":
return "https://www.facebook.com/gmemongolia/?ref=br_rs";
case "MM":
return "https://www.facebook.com/gmemyanmar/?ref=br_rs";
case "ne":
case "NP":
return "https://www.facebook.com/gmenepal/?ref=br_rs";
case "in":
case "ID":
return "https://www.facebook.com/gmeindonesia/?ref=br_rs";
case "bn":
case "BD":
return "https://www.facebook.com/gmebangladesh/?ref=br_rs";
case "ru":
case "RU":
return "https://www.facebook.com/gmenepal/?ref=br_rs";
case "uz":
case "UZ":
return "https://www.facebook.com/gmeuzbekistan/?ref=br_rs";
case "vi":
case "VN":
return "https://www.facebook.com/gmevietnam/?ref=br_rs";
case "PH":
return "https://www.facebook.com/gmephilippines/?ref=br_rs";
case "IN":
return "https://www.facebook.com/gmeremitindia/?ref=br_rs";
case "PK":
return "https://www.facebook.com/gmepakistan/?ref=br_rs";
default:
return "https://www.facebook.com/gmenepal/?ref=br_rs";

Loading…
Cancel
Save