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

master
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 {
final float newAmountValue = Float.parseFloat(amountField.getText().toString());
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.startValidating();
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="send_assets_error_invalid_cypto_coin_selected" translatable="false">Invalid crypto coin selected</string>
</resources>