From e283f7cb6575fe17eba44c0fc6da737fb65ced45 Mon Sep 17 00:00:00 2001 From: dtvv Date: Mon, 3 Sep 2018 10:49:25 -0600 Subject: [PATCH] Remove network package testing implementation --- app/build.gradle | 2 +- .../BitsharesAccountNameValidation.kt | 52 ++++++------------- build.gradle | 2 +- 3 files changed, 18 insertions(+), 38 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index c9d588c..c193220 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -53,7 +53,7 @@ dependencies { exclude group: 'com.android.support', module: 'support-annotations' }) implementation 'com.jaredrummler:material-spinner:1.2.5' - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" + implementation "org.jetbrains.kotlin:kotlin-stdlib:1.1.60" //testCompile 'com.android.support.test:runner:1.0.1' implementation 'com.afollestad.material-dialogs:core:0.9.6.0' //DTVV Thrusday 31 July 2018 implementation 'com.android.support:appcompat-v7:27.1.1' 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 f12bbe5..677e99f 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 @@ -9,6 +9,9 @@ import cy.agorise.crystalwallet.requestmanagers.ValidateExistBitsharesAccountReq import cy.agorise.crystalwallet.viewmodels.validators.customImpl.interfaces.UIValidator import cy.agorise.crystalwallet.viewmodels.validators.customImpl.interfaces.UIValidatorListener import cy.agorise.crystalwallet.views.natives.CustomTextInputEditText +import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener + + /* * @@ -166,64 +169,41 @@ class BitsharesAccountNameValidation : CustomValidationField, UIValidator { creatingAccountMaterialDialog.build() creatingAccountMaterialDialog.show() - val request = ValidateExistBitsharesAccountRequest(newValue) request.setListener { + /* - * Dismiss the dialog of loading - * */ + * Dismiss the dialog of loading + * */ creatingAccountMaterialDialog.dismiss() - if (request.accountExists) { + if (!request.accountExists) { /* - * The account exists and is not valid - * */ + * The account exists and is not valid + * */ accountNameField.fieldValidatorModel.setInvalid() accountNameField.fieldValidatorModel.message = accountNameField.resources.getString(R.string.account_name_already_exist) - /* - * Deliver the response - * */ - if (uiValidatorListener != null) { - uiValidatorListener.onValidationFailed(globalCustomValidationField) - } - - /* - * Deliver response to local callback - * */ - if (onAccountExist != null) { - onAccountExist!!.onAccountExists() - } - } else { /* - * Passed all validations - * */ + * Passed all validations + * */ accountNameField.fieldValidatorModel.setValid() /* - * Deliver the response - * */ + * Deliver the response + * */ if (uiValidatorListener != null) { uiValidatorListener.onValidationSucceeded(globalCustomValidationField) } } } + CryptoNetInfoRequests.getInstance().addRequest(request) - /*GrapheneApiGenerator.setActivity(activity); //Set the activity to catch errors - val onErrorWebSocker = object : GrapheneApiGenerator.OnErrorWebSocket { - override fun onError(exception: java.lang.Exception?) { - - creatingAccountMaterialDialog.dismiss(); - - } - - } - GrapheneApiGenerator.setOnErrorWebSocket(onErrorWebSocker); //Set the activity to catch errors - CryptoNetInfoRequests.getInstance().addRequest(request)*/ - }/* + } + /* * Passed initial validations, next final validations * */ } diff --git a/build.gradle b/build.gradle index b63175e..635a6c8 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.60" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }