From d86fe35a6bd5b0c55692c19582f948577bebcaa7 Mon Sep 17 00:00:00 2001 From: dtvv Date: Sat, 29 Sep 2018 22:21:15 -0500 Subject: [PATCH] When you create a new account the cancel button does not have to show, only when you check the brainkey --- .../crystalwallet/activities/BackupSeedActivity.java | 11 +++++++++++ .../crystalwallet/activities/CreateSeedActivity.kt | 1 + .../crystalwallet/activities/IntroActivity.java | 2 ++ .../res/layout/fragment_import_account_options.xml | 5 +++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/BackupSeedActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/BackupSeedActivity.java index 52fef67..999d66a 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/BackupSeedActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/BackupSeedActivity.java @@ -10,6 +10,7 @@ import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AppCompatActivity; +import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; @@ -34,6 +35,7 @@ public class BackupSeedActivity extends AppCompatActivity { @BindView(R.id.btnCopy) Button btnCopy; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -41,6 +43,15 @@ public class BackupSeedActivity extends AppCompatActivity { 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); if (seedId > -1) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt index 1f3f535..fdeaf06 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.kt @@ -200,6 +200,7 @@ class CreateSeedActivity : CustomActivity() { val intent = Intent(applicationContext, BackupSeedActivity::class.java) intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK intent.putExtra("SEED_ID", accountSeed.id) + intent.putExtra("newAccount", true) startActivity(intent) } else if (request.status == ValidateCreateBitsharesAccountRequest.StatusCode.ACCOUNT_EXIST) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java index f0e00d3..555ca66 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java @@ -2,9 +2,11 @@ package cy.agorise.crystalwallet.activities; import android.arch.lifecycle.ViewModelProviders; import android.content.Intent; +import android.content.pm.PackageManager; import android.media.MediaPlayer; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; diff --git a/app/src/main/res/layout/fragment_import_account_options.xml b/app/src/main/res/layout/fragment_import_account_options.xml index dc12e70..0ed744c 100644 --- a/app/src/main/res/layout/fragment_import_account_options.xml +++ b/app/src/main/res/layout/fragment_import_account_options.xml @@ -32,9 +32,10 @@ android:textColor="@color/white" android:textSize="18sp" 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_constraintEnd_toEndOf="@id/tvDescription"/> + app:layout_constraintTop_toBottomOf="@id/tvDescription" />