Browse Source

Contact list updated

master
Preyea Regmi 5 years ago
parent
commit
ce6d9330b3
  1. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/GmeApplication.java
  2. 28
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customer_support/model/CustomerSupportContact.java
  3. 52
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customer_support/view/CustomerSupportFragment.java
  4. 7
      app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/HttpClientV2.java
  5. 1
      app/src/main/res/layout/fragment_customer_support.xml

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/GmeApplication.java

@ -193,7 +193,7 @@ public class GmeApplication extends MultiDexApplication {
} }
public static String getSelectedLanguage()
public static String getPreferredCountryCode()
{ {
if(gmeSharedPreferences==null) if(gmeSharedPreferences==null)
return "en"; return "en";

28
app/src/main/java/com/gmeremit/online/gmeremittance_native/customer_support/model/CustomerSupportContact.java

@ -0,0 +1,28 @@
package com.gmeremit.online.gmeremittance_native.customer_support.model;
public class CustomerSupportContact {
String countryCode;
String customerContact;
public CustomerSupportContact(String countryCode, String customerContact) {
this.countryCode = countryCode;
this.customerContact = customerContact;
}
public String getCountryCode() {
return countryCode;
}
public void setCountryCode(String countryCode) {
this.countryCode = countryCode;
}
public String getCustomerContact() {
return customerContact;
}
public void setCustomerContact(String customerContact) {
this.customerContact = customerContact;
}
}

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

@ -14,11 +14,17 @@ import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.gmeremit.online.gmeremittance_native.GmeApplication;
import com.gmeremit.online.gmeremittance_native.R; import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.customer_support.CustomerSupportContract; import com.gmeremit.online.gmeremittance_native.customer_support.CustomerSupportContract;
import com.gmeremit.online.gmeremittance_native.customer_support.model.CustomerSupportContact;
import com.gmeremit.online.gmeremittance_native.customer_support.presenter.CustomerSupportPresenter; import com.gmeremit.online.gmeremittance_native.customer_support.presenter.CustomerSupportPresenter;
import com.gmeremit.online.gmeremittance_native.splash_screen.model.LanguageModel;
import com.gmeremit.online.gmeremittance_native.supportV2.view.SupportActivityV2; import com.gmeremit.online.gmeremittance_native.supportV2.view.SupportActivityV2;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
@ -41,6 +47,9 @@ public class CustomerSupportFragment extends DialogFragment implements CustomerS
@BindView(R.id.btnCancel) @BindView(R.id.btnCancel)
TextView btnCancel; TextView btnCancel;
@BindView(R.id.callTxtView)
TextView callTxtView;
private CustomerSupportPresenter presenter; private CustomerSupportPresenter presenter;
public static CustomerSupportFragment newInstance() { public static CustomerSupportFragment newInstance() {
@ -60,14 +69,53 @@ public class CustomerSupportFragment extends DialogFragment implements CustomerS
View view = inflater.inflate(R.layout.fragment_customer_support, container, false); View view = inflater.inflate(R.layout.fragment_customer_support, container, false);
init(view); init(view);
performDefaultAction();
return view; return view;
} }
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());
}
private List<CustomerSupportContact> getCustomerSupportContact() {
List<CustomerSupportContact> contactList = new ArrayList<>();
contactList.add(new CustomerSupportContact("EN", ""));
contactList.add(new CustomerSupportContact("KH", ""));
contactList.add(new CustomerSupportContact("KR", ""));
contactList.add(new CustomerSupportContact("TH", ""));
contactList.add(new CustomerSupportContact("LK", ""));
contactList.add(new CustomerSupportContact("MN", ""));
contactList.add(new CustomerSupportContact("MM", ""));
contactList.add(new CustomerSupportContact("NP", ""));
contactList.add(new CustomerSupportContact("ID", ""));
contactList.add(new CustomerSupportContact("BD", ""));
contactList.add(new CustomerSupportContact("RU", ""));
contactList.add(new CustomerSupportContact("UZ", ""));
contactList.add(new CustomerSupportContact("VN", ""));
}
private void init(View view) { private void init(View view) {
ButterKnife.bind(this, view); ButterKnife.bind(this, view);
presenter = new CustomerSupportPresenter(this); presenter = new CustomerSupportPresenter(this);
} }
@OnClick({R.id.viewLiveChat, R.id.viewCall, R.id.viewEmail, R.id.btnCancel}) @OnClick({R.id.viewLiveChat, R.id.viewCall, R.id.viewEmail, R.id.btnCancel})
@ -118,7 +166,7 @@ public class CustomerSupportFragment extends DialogFragment implements CustomerS
@Override @Override
public void handleCall() { public void handleCall() {
Intent call = new Intent(Intent.ACTION_DIAL); Intent call = new Intent(Intent.ACTION_DIAL);
call.setData(Uri.parse("tel: " + "1588 6864"));
call.setData(Uri.parse("tel: " + callTxtView.getText().toString()));
startActivity(call); startActivity(call);
} }

7
app/src/main/java/com/gmeremit/online/gmeremittance_native/utils/https/HttpClientV2.java

@ -1,6 +1,5 @@
package com.gmeremit.online.gmeremittance_native.utils.https; package com.gmeremit.online.gmeremittance_native.utils.https;
import android.content.Context;
import android.util.Log; import android.util.Log;
import com.gmeremit.online.gmeremittance_native.BuildConfig; import com.gmeremit.online.gmeremittance_native.BuildConfig;
@ -9,13 +8,9 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder; import com.google.gson.GsonBuilder;
import java.io.File; import java.io.File;
import java.io.FileOutputStream;
import java.io.FileWriter; import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import okhttp3.Interceptor; import okhttp3.Interceptor;
@ -53,7 +48,7 @@ public class HttpClientV2 {
Interceptor authInterceptor = chain -> { Interceptor authInterceptor = chain -> {
Request newRequest = chain.request().newBuilder() Request newRequest = chain.request().newBuilder()
.addHeader("GME-TOKEN", "39587YT398@FBQOW8RY3#948R7GB@CNEQW987GF87$TD18$1981..919@@##joghndvberteiru") .addHeader("GME-TOKEN", "39587YT398@FBQOW8RY3#948R7GB@CNEQW987GF87$TD18$1981..919@@##joghndvberteiru")
.addHeader("lang",GmeApplication.getSelectedLanguage().toLowerCase())
.addHeader("lang",GmeApplication.getPreferredCountryCode().toLowerCase())
.build(); .build();
return chain.proceed(newRequest); return chain.proceed(newRequest);
}; };

1
app/src/main/res/layout/fragment_customer_support.xml

@ -86,6 +86,7 @@
android:src="@drawable/ic_support_phone" /> android:src="@drawable/ic_support_phone" />
<com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView <com.gmeremit.online.gmeremittance_native.customwidgets.GmeTextView
android:id="@+id/callTxtView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="19dp" android:layout_marginLeft="19dp"

Loading…
Cancel
Save