From 41a3b1c17227b500e5ca2f0c2c3ed8fb309c051f Mon Sep 17 00:00:00 2001 From: dtvv Date: Wed, 24 Oct 2018 02:01:44 -0500 Subject: [PATCH] In the create seed activity when the user types it validates with the server each time, this has to be done til the user touches the CREATE WALLET button for performance --- .../activities/CreateSeedActivity.kt | 47 +------------------ .../BitsharesAccountNameValidation.kt | 1 + 2 files changed, 2 insertions(+), 46 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt index 4b5f6fc..776dc4c 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt @@ -259,52 +259,7 @@ class CreateSeedActivity : CustomActivity() { * */ if (result) { - /* - * Show the dialog for connection with the server - * */ - val creatingAccountMaterialDialog = CrystalDialog(globalActivity) - creatingAccountMaterialDialog.setText(globalActivity.resources.getString(R.string.window_create_seed_Server_validation)) - creatingAccountMaterialDialog.progress() - creatingAccountMaterialDialog.show() - - /* - * Validate the account does not exists - * */ - val request = ValidateExistBitsharesAccountRequest(tietAccountName?.text.toString()) - request.setListener { - - /* - * Dismiss the dialog of loading - * */ - creatingAccountMaterialDialog.dismiss() - - if (request.accountExists) { - - /* - * The account exists and is not valid - * */ - tietAccountName.fieldValidatorModel.setInvalid() - tietAccountName.fieldValidatorModel.message = tietAccountName.resources.getString(R.string.account_name_already_exist) - - /* - * Disaible button create - * */ - disableCreate() - - } else { - - /* - * Passed all validations - * */ - tietAccountName.fieldValidatorModel.setValid() - - /* - * Enable button create - * */ - enableCreate() - } - } - CryptoNetInfoRequests.getInstance().addRequest(request) + enableCreate() } else { diff --git a/app/src/main/java/cy/agorise/crystalwallet/viewmodels/validators/customImpl/validationFields/BitsharesAccountNameValidation.kt b/app/src/main/java/cy/agorise/crystalwallet/viewmodels/validators/customImpl/validationFields/BitsharesAccountNameValidation.kt index 2f6f002..1b52c8b 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/viewmodels/validators/customImpl/validationFields/BitsharesAccountNameValidation.kt +++ b/app/src/main/java/cy/agorise/crystalwallet/viewmodels/validators/customImpl/validationFields/BitsharesAccountNameValidation.kt @@ -101,6 +101,7 @@ class BitsharesAccountNameValidation : CustomValidationField, UIValidator { result = false accountNameField.fieldValidatorModel.setInvalid() accountNameField.fieldValidatorModel.message = this.accountNameField.resources.getString(R.string.create_account_window_err_at_least_one_character) + } else { /*