From 5a09afe0ad1faffa1889a81d4d525272f876b295 Mon Sep 17 00:00:00 2001 From: preyearegmi Date: Fri, 1 Feb 2019 10:28:23 +0900 Subject: [PATCH] Rate calculator fixes --- .../view/ExchangeMethodV2Activity.java | 37 ++++++++++--------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java index d14a968b..223fd2ae 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java @@ -211,33 +211,36 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod } //TODO Implementation for calculating exchange rate on the basis of provided default receiving amount for native country only // - @Override - public void onCountrySelected(CountryPaymentService countryPaymentService) { - this.selectedCountryPaymentService = countryPaymentService; - showSelectedRecipient(countryPaymentService.getCountryCode(), countryPaymentService.getCurrency()); - registerAvailableTextWatchersForEditText(recieveMoneyEditText, false); - recieveMoneyEditText.setText(""); - shouldCaulatedByRecipient = false; - registerAvailableTextWatchersForEditText(recieveMoneyEditText, true); - showPaymentService(true, countryPaymentService.getServiceAvailable()); - if (this.countryListingDialog != null) { - this.countryListingDialog.hideKeyboard(); - this.countryListingDialog.dismiss(); - } - } - -//TODO Implementation for calculating exchange rate on the basis of provided default receiving amount for corresponding currency. // @Override // public void onCountrySelected(CountryPaymentService countryPaymentService) { // this.selectedCountryPaymentService = countryPaymentService; // showSelectedRecipient(countryPaymentService.getCountryCode(), countryPaymentService.getCurrency()); +// registerAvailableTextWatchersForEditText(recieveMoneyEditText, false); +// recieveMoneyEditText.setText(""); +// shouldCaulatedByRecipient = false; +// registerAvailableTextWatchersForEditText(recieveMoneyEditText, true); +// showPaymentService(true, countryPaymentService.getServiceAvailable()); // if (this.countryListingDialog != null) { // this.countryListingDialog.hideKeyboard(); // this.countryListingDialog.dismiss(); // } -// this.presenter.getDefaultReceivingAmountForSelectedCurrency(countryPaymentService); // } +//TODO Implementation for calculating exchange rate on the basis of provided default receiving amount for corresponding currency. + @Override + public void onCountrySelected(CountryPaymentService countryPaymentService) { + if (this.countryListingDialog != null) { + this.countryListingDialog.hideKeyboard(); + this.countryListingDialog.dismiss(); + } + if(this.selectedCountryPaymentService!=null&&(this.selectedCountryPaymentService.getCurrency().equalsIgnoreCase(countryPaymentService.getCurrency()))&&(this.selectedCountryPaymentService.getCountryCode().equalsIgnoreCase(countryPaymentService.getCountryCode()))) + return; + + this.selectedCountryPaymentService = countryPaymentService; + showSelectedRecipient(countryPaymentService.getCountryCode(), countryPaymentService.getCurrency()); + this.presenter.getDefaultReceivingAmountForSelectedCurrency(countryPaymentService); + } + @Override public void updateReceivingAmountAndFetchExchangeRate(String amount) {