|
@ -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); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|