When you create a new account the cancel button does not have to show, only when you check the brainkey

This commit is contained in:
dtvv 2018-09-29 22:21:15 -05:00
parent ad0c14e389
commit d86fe35a6b
4 changed files with 17 additions and 2 deletions

View file

@ -10,6 +10,7 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
@ -34,6 +35,7 @@ public class BackupSeedActivity extends AppCompatActivity {
@BindView(R.id.btnCopy) @BindView(R.id.btnCopy)
Button btnCopy; Button btnCopy;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -41,6 +43,15 @@ public class BackupSeedActivity extends AppCompatActivity {
ButterKnife.bind(this); ButterKnife.bind(this);
/*
* If comes from new account creation hide the cancel button
* */
Bundle b = getIntent().getExtras();
boolean newAccount = b.getBoolean("newAccount");
if(newAccount ){
btnOk.setVisibility(View.INVISIBLE);
}
long seedId = getIntent().getLongExtra("SEED_ID",-1); long seedId = getIntent().getLongExtra("SEED_ID",-1);
if (seedId > -1) { if (seedId > -1) {

View file

@ -200,6 +200,7 @@ class CreateSeedActivity : CustomActivity() {
val intent = Intent(applicationContext, BackupSeedActivity::class.java) val intent = Intent(applicationContext, BackupSeedActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
intent.putExtra("SEED_ID", accountSeed.id) intent.putExtra("SEED_ID", accountSeed.id)
intent.putExtra("newAccount", true)
startActivity(intent) startActivity(intent)
} }
else if (request.status == ValidateCreateBitsharesAccountRequest.StatusCode.ACCOUNT_EXIST) { else if (request.status == ValidateCreateBitsharesAccountRequest.StatusCode.ACCOUNT_EXIST) {

View file

@ -2,9 +2,11 @@ package cy.agorise.crystalwallet.activities;
import android.arch.lifecycle.ViewModelProviders; import android.arch.lifecycle.ViewModelProviders;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageManager;
import android.media.MediaPlayer; import android.media.MediaPlayer;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction; import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;

View file

@ -32,9 +32,10 @@
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="18sp" android:textSize="18sp"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/tvDescription" app:layout_constraintEnd_toEndOf="@id/tvDescription"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="@id/tvDescription" app:layout_constraintStart_toStartOf="@id/tvDescription"
app:layout_constraintEnd_toEndOf="@id/tvDescription"/> app:layout_constraintTop_toBottomOf="@id/tvDescription" />
<Button <Button
android:id="@+id/btnImportSeed" android:id="@+id/btnImportSeed"