- Added dialog when creating a new bitshares account

This commit is contained in:
Javier Varona 2018-01-11 22:04:35 -04:00
parent e13abecd7f
commit 76b5a6885d
3 changed files with 60 additions and 2 deletions

View file

@ -2,8 +2,10 @@ package cy.agorise.crystalwallet.activities;
import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
@ -108,9 +110,26 @@ public class CreateSeedActivity extends AppCompatActivity implements UIValidator
final ValidateCreateBitsharesAccountRequest request =
new ValidateCreateBitsharesAccountRequest(etAccountName.getText().toString(), getApplicationContext());
//Makes dialog to tell the user that the account is been created
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(CreateSeedActivity.this,R.style.AppTheme);
alertBuilder.setView(R.layout.progress_creating_account);
//alertBuilder.setTitle("Processing");
//alertBuilder.setMessage("Creating Bitshares Account");
final AlertDialog processDialog = alertBuilder.create();
CreateSeedActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
processDialog.show();
processDialog.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
});
request.setListener(new CryptoNetInfoRequestListener() {
@Override
public void onCarryOut() {
processDialog.dismiss();
if (request.getAccount() != null){
finish();
} else {
@ -118,7 +137,17 @@ public class CreateSeedActivity extends AppCompatActivity implements UIValidator
}
}
});
CryptoNetInfoRequests.getInstance().addRequest(request);
Thread thread = new Thread() {
@Override
public void run() {
CryptoNetInfoRequests.getInstance().addRequest(request);
}
};
thread.start();
//this.finish();
}

View file

@ -53,7 +53,7 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
}
public void validate(){
if ((this.accountExists != null) && (this.account != null)){
if ((this.accountExists != null)){// && (this.account != null)){
this._fireOnCarryOutEvent();
}
}

View file

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="@dimen/activity_vertical_margin">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/ivProgressCreatingAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/loader_homescreen" />
<TextView
android:id="@+id/tvProgressCreatingAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toEndOf="@+id/ivProgressCreatingAccount"
android:text="Creating New Account..." />
</RelativeLayout>
</LinearLayout>