From e16d651a6355f01f1178ca92e6cfb78b9dd2b9e6 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Tue, 8 Jan 2019 20:53:57 -0600 Subject: [PATCH] Fix crash related to trying to create a Dialog from a thread other than the UI thread. Also, add the password toggle buttons to the PIN fields in CreateAccountFragment. --- .../fragments/CreateAccountFragment.kt | 7 ++++--- .../agorise/bitsybitshareswallet/models/FaucetAccount.java | 1 - app/src/main/res/layout/fragment_create_account.xml | 7 +++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt index 3cc2730..467c7ed 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/CreateAccountFragment.kt @@ -1,7 +1,7 @@ package cy.agorise.bitsybitshareswallet.fragments import android.os.Bundle -import android.preference.PreferenceManager +import android.os.Handler import android.util.Log import android.view.LayoutInflater import android.view.View @@ -35,7 +35,6 @@ import cy.agorise.bitsybitshareswallet.network.ServiceGenerator import retrofit2.Call import retrofit2.Response import java.util.* -import kotlin.concurrent.timerTask class CreateAccountFragment : BaseAccountFragment() { @@ -231,7 +230,9 @@ class CreateAccountFragment : BaseAccountFragment() { override fun onResponse(call: Call, response: Response) { // The network call was a success and we got a response, obtain the info of the newly created account // with a delay to let the nodes update their information - Timer().schedule(timerTask { + val handler = Handler() + + handler.postDelayed({ getCreatedAccountInfo(response.body()) }, 4000) } diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/models/FaucetAccount.java b/app/src/main/java/cy/agorise/bitsybitshareswallet/models/FaucetAccount.java index 40d3ef4..911a784 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/models/FaucetAccount.java +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/models/FaucetAccount.java @@ -4,7 +4,6 @@ package cy.agorise.bitsybitshareswallet.models; * Class used to deserialize a the "account" object contained in the faucet response to the * {@link cy.agorise.bitsybitshareswallet.network.FaucetService#registerPrivateAccount(FaucetRequest)} API call. */ - public class FaucetAccount { public String name; public String owner_key; diff --git a/app/src/main/res/layout/fragment_create_account.xml b/app/src/main/res/layout/fragment_create_account.xml index 0d74e3f..ff32d01 100644 --- a/app/src/main/res/layout/fragment_create_account.xml +++ b/app/src/main/res/layout/fragment_create_account.xml @@ -2,6 +2,7 @@ + android:hint="@string/text_field__6_digit_pin" + app:passwordToggleEnabled="true"> + android:hint="@string/text_field__confirm_pin" + app:passwordToggleEnabled="true">