- Added dialog when creating a new bitshares account
This commit is contained in:
parent
e13abecd7f
commit
76b5a6885d
3 changed files with 60 additions and 2 deletions
|
@ -2,8 +2,10 @@ package cy.agorise.crystalwallet.activities;
|
||||||
|
|
||||||
import android.arch.lifecycle.ViewModelProviders;
|
import android.arch.lifecycle.ViewModelProviders;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
@ -108,9 +110,26 @@ public class CreateSeedActivity extends AppCompatActivity implements UIValidator
|
||||||
final ValidateCreateBitsharesAccountRequest request =
|
final ValidateCreateBitsharesAccountRequest request =
|
||||||
new ValidateCreateBitsharesAccountRequest(etAccountName.getText().toString(), getApplicationContext());
|
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() {
|
request.setListener(new CryptoNetInfoRequestListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCarryOut() {
|
public void onCarryOut() {
|
||||||
|
processDialog.dismiss();
|
||||||
|
|
||||||
if (request.getAccount() != null){
|
if (request.getAccount() != null){
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
|
@ -118,7 +137,17 @@ public class CreateSeedActivity extends AppCompatActivity implements UIValidator
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Thread thread = new Thread() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
CryptoNetInfoRequests.getInstance().addRequest(request);
|
CryptoNetInfoRequests.getInstance().addRequest(request);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
thread.start();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//this.finish();
|
//this.finish();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class ValidateCreateBitsharesAccountRequest extends CryptoNetInfoRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validate(){
|
public void validate(){
|
||||||
if ((this.accountExists != null) && (this.account != null)){
|
if ((this.accountExists != null)){// && (this.account != null)){
|
||||||
this._fireOnCarryOutEvent();
|
this._fireOnCarryOutEvent();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
29
app/src/main/res/layout/progress_creating_account.xml
Normal file
29
app/src/main/res/layout/progress_creating_account.xml
Normal 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>
|
Loading…
Reference in a new issue