-Add error text in the amount field when there is a invalid selected crypto coin

This commit is contained in:
dtvv 2018-09-13 22:59:35 -05:00
parent da290acddc
commit 8e00c08d6a
2 changed files with 14 additions and 1 deletions

View file

@ -30,7 +30,18 @@ public class AmountValidationField extends ValidationField {
try { try {
final float newAmountValue = Float.parseFloat(amountField.getText().toString()); final float newAmountValue = Float.parseFloat(amountField.getText().toString());
final CryptoCurrency cryptoCurrency = (CryptoCurrency)assetSpinner.getSelectedItem(); final CryptoCurrency cryptoCurrency = (CryptoCurrency)assetSpinner.getSelectedItem();
final String mixedValues = newAmountValue+"_"+cryptoCurrency.getId();
/*
* Validation for the money
* */
if(cryptoCurrency==null){
setMessageForValue("",amountField.getContext().getString(R.string.send_assets_error_invalid_cypto_coin_selected));
setValidForValue("", false);
return;
}
final String idCurrency = cryptoCurrency==null?"null ":Long.toString(cryptoCurrency.getId());
final String mixedValues = newAmountValue + "_" + idCurrency;
this.setLastValue(mixedValues); this.setLastValue(mixedValues);
this.startValidating(); this.startValidating();
final ValidationField field = this; final ValidationField field = this;

View file

@ -11,5 +11,7 @@
<string name="network_err_no_server_connection" translatable="false">No server connection</string> <string name="network_err_no_server_connection" translatable="false">No server connection</string>
<string name="send_assets_error_invalid_cypto_coin_selected" translatable="false">Invalid crypto coin selected</string>
</resources> </resources>