-Add error text in the amount field when there is a invalid selected crypto coin
This commit is contained in:
parent
da290acddc
commit
8e00c08d6a
2 changed files with 14 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue