From fc80baf731cf87ff9f8c35648279248c19e9ddbc Mon Sep 17 00:00:00 2001 From: Javier Varona Date: Sat, 13 Jan 2018 22:16:54 -0400 Subject: [PATCH] - Fixing Account Existing Verification --- .../activities/CreateSeedActivity.java | 26 ++++++++++++------- .../manager/BitsharesAccountManager.java | 6 ++++- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java index 3d31494..7c4a88b 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java @@ -189,15 +189,21 @@ public class CreateSeedActivity extends AppCompatActivity implements UIValidator } @Override - public void onValidationFailed(ValidationField field) { - if (field.getView() == etPin) { - tvPinError.setText(field.getMessage()); - } else if (field.getView() == etPinConfirmation){ - tvPinConfirmationError.setText(field.getMessage()); - } else if (field.getView() == etAccountName){ - tvAccountNameError.setText(field.getMessage()); - } //else if (field.getView() == etSeedWords){ - // tvSeedWordsError.setText(field.getMessage()); - //} + public void onValidationFailed(final ValidationField field) { + runOnUiThread(new Runnable() { + + @Override + public void run() { + if (field.getView() == etPin) { + tvPinError.setText(field.getMessage()); + } else if (field.getView() == etPinConfirmation){ + tvPinConfirmationError.setText(field.getMessage()); + } else if (field.getView() == etAccountName){ + tvAccountNameError.setText(field.getMessage()); + } //else if (field.getView() == etSeedWords){ + // tvSeedWordsError.setText(field.getMessage()); + //} + } + }); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java index 249d443..eec7f1e 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java +++ b/app/src/main/java/cy/agorise/crystalwallet/manager/BitsharesAccountManager.java @@ -245,7 +245,11 @@ public class BitsharesAccountManager implements CryptoAccountManager, CryptoNetI ApiRequest checkAccountName = new ApiRequest(0, new ApiRequestListener() { @Override public void success(Object answer, int idPetition) { - validateRequest.setAccountExists(true); + if (answer != null) { + validateRequest.setAccountExists(true); + } else { + validateRequest.setAccountExists(false); + } } @Override