From 1cd36489ebc1463c98e67f9830f4f0cee697bedb Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 31 Jul 2018 13:18:13 -0500 Subject: [PATCH 01/14] =?UTF-8?q?-I=20fix=20a=20bug:=20The=20loading=20ico?= =?UTF-8?q?n=20was=20static=20after=20the=20registraron=20of=20the=20user.?= =?UTF-8?q?=20(I=20attached=20prove=20in=20telegram)=20-Change=20=E2=80=9C?= =?UTF-8?q?seed=E2=80=9D=20text=20to=20=E2=80=9CBackup=20brainkey=E2=80=9D?= =?UTF-8?q?=20-Add=20backup=20leyend=20-Set=20icon=20for=20button=20ok=20-?= =?UTF-8?q?Add=20button=20=E2=80=9CCopy=E2=80=9D=20to=20copy=20brainkey=20?= =?UTF-8?q?to=20clipboard=20-Develope=20algoritm=20for=20copy=20to=20clipb?= =?UTF-8?q?oard=20functionality?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 9 ++ .../activities/BackupSeedActivity.java | 38 +++++- .../activities/CreateSeedActivity.java | 45 +++++-- app/src/main/res/anim/rotate360.xml | 6 +- app/src/main/res/layout/backup_seed.xml | 117 ++++++++++++------ app/src/main/res/values/strings.xml | 4 + 6 files changed, 166 insertions(+), 53 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6aed77d..a5182a0 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + + + + + + () { @Override public void onChanged(@Nullable AccountSeed accountSeed) { - tvMnemonic.setText(accountSeed.getMasterSeed()); + textfieldBrainkey.setText(accountSeed.getMasterSeed()); } }); accountSeedViewModel.loadSeed(seedId); @@ -56,4 +70,22 @@ public class BackupSeedActivity extends AppCompatActivity { Intent intent = new Intent(this, IntroActivity.class); startActivity(intent); } + + /* + * Clic on button copy to clipboard + * */ + @OnClick(R.id.backup_seed_view_button_copy) + public void btnCopyClick(){ + + /* + * Save to clipboard the brainkey chain + * */ + ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); + ClipData clip = ClipData.newPlainText(textfieldBrainkey.getText(), textfieldBrainkey.getText().toString()); + clipboard.setPrimaryClip(clip); + + /* + * Success message + * */ + } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java index aa6d024..bb1f7a9 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/CreateSeedActivity.java @@ -16,6 +16,7 @@ import butterknife.ButterKnife; import butterknife.OnClick; import butterknife.OnTextChanged; import cy.agorise.crystalwallet.R; +import cy.agorise.crystalwallet.dialogs.ProgressCreatingAccountDialog; import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequestListener; import cy.agorise.crystalwallet.requestmanagers.CryptoNetInfoRequests; import cy.agorise.crystalwallet.requestmanagers.ValidateCreateBitsharesAccountRequest; @@ -25,6 +26,35 @@ import cy.agorise.crystalwallet.viewmodels.validators.CreateSeedValidator; import cy.agorise.crystalwallet.viewmodels.validators.UIValidatorListener; import cy.agorise.crystalwallet.viewmodels.validators.validationfields.ValidationField; + + +/* +* Commented code backup +* +* +* alertBuilder.setTitle("Processing"); + alertBuilder.setMessage("Creating Bitshares Account"); + + ------ + + AlertDialog.Builder alertBuilder = new AlertDialog.Builder(CreateSeedActivity.this,R.style.AppTheme); + alertBuilder.setView(R.layout.progress_creating_account); + final AlertDialog processDialog = alertBuilder.create(); + CreateSeedActivity.this.runOnUiThread(new Runnable() { //Run on UI Thread + @Override + public void run() { + processDialog.setCancelable(false); + processDialog.show(); + processDialog.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + } + }); + + */ + + + + + public class CreateSeedActivity extends AppCompatActivity implements UIValidatorListener { AccountSeedViewModel accountSeedViewModel; @@ -111,25 +141,20 @@ public class CreateSeedActivity extends AppCompatActivity implements UIValidator new ValidateCreateBitsharesAccountRequest(tietAccountName.getText().toString(), getApplicationContext()); + //DTVV: Friday 27 July 2018 //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(); + final ProgressCreatingAccountDialog progressCreatingAccountDialog = new ProgressCreatingAccountDialog(CreateSeedActivity.this); + progressCreatingAccountDialog.show(); CreateSeedActivity.this.runOnUiThread(new Runnable() { @Override public void run() { - processDialog.setCancelable(false); - processDialog.show(); - processDialog.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT); + progressCreatingAccountDialog.show(); } }); - request.setListener(new CryptoNetInfoRequestListener() { @Override public void onCarryOut() { - processDialog.dismiss(); + progressCreatingAccountDialog.dismiss(); if (request.getStatus().equals(ValidateCreateBitsharesAccountRequest.StatusCode.SUCCEEDED)) { GrapheneAccount accountSeed = request.getAccount(); Intent intent = new Intent(getApplicationContext(), BackupSeedActivity.class); diff --git a/app/src/main/res/anim/rotate360.xml b/app/src/main/res/anim/rotate360.xml index 0efcc73..c582275 100644 --- a/app/src/main/res/anim/rotate360.xml +++ b/app/src/main/res/anim/rotate360.xml @@ -1,13 +1,17 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/backup_seed.xml b/app/src/main/res/layout/backup_seed.xml index 9166b1c..26ab090 100644 --- a/app/src/main/res/layout/backup_seed.xml +++ b/app/src/main/res/layout/backup_seed.xml @@ -1,52 +1,91 @@ - - + android:layout_centerInParent="true"> - - - - -