From 054f062ce1c6dbd5904ce39c757a8853707f3a2f Mon Sep 17 00:00:00 2001 From: dtvv Date: Wed, 19 Sep 2018 20:07:38 -0500 Subject: [PATCH] When account exists or not, enable or disable on main thread the button "create wallet" --- .../crystalwallet/activities/CreateSeedActivity.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 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 fa12a2c..9996daf 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt @@ -23,6 +23,8 @@ import cy.agorise.crystalwallet.views.natives.CustomTextInputEditText import kotlinx.android.synthetic.main.create_seed.* + + /* * This activity creates a new account with some security concerns * */ @@ -283,15 +285,19 @@ class CreateSeedActivity : CustomActivity() { * Enable create button * */ private fun enableCreate() { - btnCreate?.setEnabled(true) - btnCreate?.setBackgroundColor(resources.getColor(R.color.colorPrimary)) + runOnUiThread(Runnable { + btnCreate?.setBackgroundColor(resources.getColor(R.color.colorPrimary)) + btnCreate?.setEnabled(true) + }) } /* * Disable create button * */ private fun disableCreate() { - btnCreate?.setEnabled(false) - btnCreate?.setBackground(resources.getDrawable(R.drawable.disable_style)) + runOnUiThread(Runnable { + btnCreate?.setEnabled(false) + btnCreate?.setBackground(resources.getDrawable(R.drawable.disable_style)) + }) } } \ No newline at end of file