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.

This commit is contained in:
Severiano Jaramillo 2019-01-08 20:53:57 -06:00
parent 8894c48e5c
commit e16d651a63
3 changed files with 9 additions and 6 deletions

View file

@ -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<FaucetResponse>, response: Response<FaucetResponse>) {
// 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)
}

View file

@ -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;

View file

@ -2,6 +2,7 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -48,7 +49,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:hint="@string/text_field__6_digit_pin">
android:hint="@string/text_field__6_digit_pin"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tietPin"
@ -64,7 +66,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_same_topic"
android:hint="@string/text_field__confirm_pin">
android:hint="@string/text_field__confirm_pin"
app:passwordToggleEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/tietPinConfirmation"