Browse Source

Exchange rate fixes

master
preyearegmi 6 years ago
parent
commit
c0860ec348
  1. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/ExchangeRateCurrencyListingDialog.java
  2. 30
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java
  3. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2PresenterInterface.java
  4. 6
      app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/customwidgets/exchangecountrylistingdialog/ExchangeRateCurrencyListingDialog.java

@ -15,6 +15,7 @@ import android.view.Window;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;
import com.gmeremit.online.gmeremittance_native.R;
import com.gmeremit.online.gmeremittance_native.customwidgets.LineDividerItemDecoration;
@ -32,6 +33,7 @@ public class ExchangeRateCurrencyListingDialog extends DialogFragment implements
private EditText noCountryFoundView;
private EditText searchEditTextView;
private CountryListingRvAdapter countryListingRvAdapter;
private TextView dialogTitle;
@Override
@ -40,6 +42,7 @@ public class ExchangeRateCurrencyListingDialog extends DialogFragment implements
View view = getActivity().getLayoutInflater().inflate(R.layout.dialog_country_listing, null);
countryListRv = view.findViewById(R.id.countryListRv);
noCountryFoundView = view.findViewById(R.id.noCountryFoundTextView);
dialogTitle = view.findViewById(R.id.dialog_title_txt);
cancelButton = view.findViewById(R.id.iv_cancel);
searchEditTextView = view.findViewById(R.id.searchEditText);
@ -52,6 +55,7 @@ public class ExchangeRateCurrencyListingDialog extends DialogFragment implements
}
private void initialize() {
dialogTitle.setText("Select Currency");
cancelButton.setOnClickListener(this);
searchEditTextView.addTextChangedListener(this);
countryListingRvAdapter = new CountryListingRvAdapter(this.listener);

30
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2Presenter.java

@ -49,6 +49,11 @@ public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRa
return;
if(!validateAmount(sendAmount))
return;
if(selectedCountryPaymentService==null)
{
view.showToastMessage("Please select a currency");
return;
}
String sendCountryDefault="118";
compositeDisposables.add(
@ -120,17 +125,18 @@ public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRa
else
{
view.showPopUpMessage(paymentServiceApiResponse.paymentServiceApiResponse.getMessage(), CustomAlertDialog.AlertType.FAILED,null);
view.clearCurrencyData();
}
}
@Override
public void onFailed(String message) {
Log.d("ExchangeV2", "Failed:" + message);
view.clearCurrencyData();
}
@Override
protected void onConnectionNotEstablished(String message) {
Log.d("ExchangeV2", "ConnectionNotEstablished:" + message);
view.clearCurrencyData();
}
}
@ -179,28 +185,22 @@ public class ExchangeRateV2Presenter extends BasePresenter implements ExchangeRa
view.updateExchangeRates(recipientAmount, sendAmount, transferDisplay, exRateDisplay);
}
else
view.showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED,null);
else {
view.showPopUpMessage(exchangeCalculationApiResponse.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
}
}
@Override
public void onFailed(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, new CustomAlertDialog.CustomDialogActionListener() {
@Override
public void onCutomDialogActionPressed(CustomAlertDialog.AlertType alertType) {
}
});
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null);
}
@Override
protected void onConnectionNotEstablished(String message) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, new CustomAlertDialog.CustomDialogActionListener() {
@Override
public void onCutomDialogActionPressed(CustomAlertDialog.AlertType alertType) {
view.showPopUpMessage(message, CustomAlertDialog.AlertType.NO_INTERNET, null);
}
});
}
}
}

2
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/presenter/ExchangeRateV2PresenterInterface.java

@ -21,5 +21,7 @@ public interface ExchangeRateV2PresenterInterface extends BasePresenterInterface
void showCountryServiceData(List<CountryPaymentService> countryPaymentServiceList, CountryPaymentService defaultCountryService,String recepientSeedValue);
void updateExchangeRates(String recipientAmount, String sendAmount, String transferDisplay, String exRateDisplay);
void clearCurrencyData();
}
}

6
app/src/main/java/com/gmeremit/online/gmeremittance_native/exchange_rate/view/ExchangeMethodV2Activity.java

@ -186,6 +186,12 @@ public class ExchangeMethodV2Activity extends BaseActivity implements PaymentMod
this.recepientCurrencyTextView.setText(selectedCountryCurrency);
}
@Override
public void clearCurrencyData() {
this.recepientFlagImageView.setBackgroundResource(0);
this.recepientCurrencyTextView.setText("---");
}
@Override
public void onClick(View v) {
switch (v.getId()) {

Loading…
Cancel
Save