In the backup seed screen there is not option for brainkey backup

This commit is contained in:
dtvv 2018-09-06 14:22:42 -05:00
parent fd5037f1af
commit a1876733f5
6 changed files with 93 additions and 62 deletions

View file

@ -18,6 +18,7 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.fragments.BackupsSettingsFragment;
import cy.agorise.crystalwallet.models.AccountSeed; import cy.agorise.crystalwallet.models.AccountSeed;
import cy.agorise.crystalwallet.viewmodels.AccountSeedViewModel; import cy.agorise.crystalwallet.viewmodels.AccountSeedViewModel;
@ -28,7 +29,7 @@ public class BackupSeedActivity extends AppCompatActivity {
@BindView(R.id.tvBrainKey) @BindView(R.id.tvBrainKey)
TextView textfieldBrainkey; TextView textfieldBrainkey;
@BindView(R.id.btnOk) @BindView(R.id.btnCancel)
Button btnOk; Button btnOk;
@BindView(R.id.btnCopy) @BindView(R.id.btnCopy)
Button btnCopy; Button btnCopy;
@ -60,14 +61,14 @@ public class BackupSeedActivity extends AppCompatActivity {
accountSeedViewModel.loadSeed(seedId); accountSeedViewModel.loadSeed(seedId);
} else { } else {
finish(); finish();
} }
} }
@OnClick(R.id.btnOk) @OnClick(R.id.btnCancel)
public void btnOkClick(){ public void btnOkClick(){
Intent intent = new Intent(this, IntroActivity.class); finish();
startActivity(intent);
} }
/* /*

View file

@ -2,6 +2,7 @@ package cy.agorise.crystalwallet.fragments;
import android.arch.lifecycle.LiveData; import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer; import android.arch.lifecycle.Observer;
import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.os.Environment; import android.os.Environment;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
@ -24,6 +25,8 @@ import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import butterknife.OnClick; import butterknife.OnClick;
import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.activities.BackupSeedActivity;
import cy.agorise.crystalwallet.activities.IntroActivity;
import cy.agorise.crystalwallet.dao.CrystalDatabase; import cy.agorise.crystalwallet.dao.CrystalDatabase;
import cy.agorise.crystalwallet.models.GeneralSetting; import cy.agorise.crystalwallet.models.GeneralSetting;
import cy.agorise.crystalwallet.requestmanagers.CreateBackupRequest; import cy.agorise.crystalwallet.requestmanagers.CreateBackupRequest;
@ -47,6 +50,9 @@ public class BackupsSettingsFragment extends Fragment{
return fragment; return fragment;
} }
@BindView(R.id.btnBrainkey)
public Button btnBrainkey;
@BindView(R.id.tvBinFile) @BindView(R.id.tvBinFile)
public TextView tvBinFile; public TextView tvBinFile;
@ -81,6 +87,15 @@ public class BackupsSettingsFragment extends Fragment{
return ssb; return ssb;
} }
@OnClick(R.id.btnBrainkey)
public void btnBrainOnClick(){
Intent intent = new Intent(getContext(), BackupSeedActivity.class);
startActivity(intent);
}
@OnClick(R.id.btnBinFile) @OnClick(R.id.btnBinFile)
public void makeBackupFile(){ public void makeBackupFile(){
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="0" android:toXDelta="10" android:duration="1000"
android:interpolator="@anim/cycle_7" />

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="4dp"
android:topRightRadius="4dp"
android:bottomRightRadius="4dp"
android:bottomLeftRadius="4dp" />
<stroke
android:width="1dp"
android:color="#0099ff" />
</shape>

View file

@ -3,89 +3,86 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/white"
android:paddingBottom="0dp" android:paddingBottom="0dp"
android:paddingLeft="0dp" android:paddingLeft="25dp"
android:paddingRight="0dp" android:paddingRight="25dp"
android:paddingTop="@dimen/activity_vertical_margin"> android:paddingTop="@dimen/activity_vertical_margin">
<RelativeLayout <RelativeLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="370dp"
android:layout_centerInParent="true"> android:background="@color/white"
android:padding="20dp"
android:layout_alignParentStart="true"
android:layout_centerVertical="true">
<TextView <TextView
android:id="@+id/tvMnemonicTitle" android:id="@+id/tvMnemonicTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin" android:layout_alignParentTop="true"
android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_alignStart="@+id/linearlayout1"
android:layout_marginTop="10dp" android:layout_marginTop="35dp"
android:layout_marginBottom="20dp"
android:text="@string/window_seed_backup" android:text="@string/window_seed_backup"
android:layout_centerHorizontal="true" android:textColor="@color/black"
android:textSize="20dp" android:textSize="25dp"
android:textStyle="bold" /> android:textStyle="bold" />
<LinearLayout
android:id="@+id/linearlayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvMnemonicTitle"
android:layout_marginTop="35dp"
android:background="@drawable/square"
android:padding="10dp">
<TextView <TextView
android:id="@+id/tvBrainKey" android:id="@+id/tvBrainKey"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/tvMnemonicTitle"
android:layout_marginLeft="@dimen/activity_horizontal_margin" android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin" android:layout_marginRight="@dimen/activity_horizontal_margin"
android:gravity="center" android:gravity="center"
android:background="@drawable/edittext_bg" android:background="#00000000"
android:layout_centerHorizontal="true" android:textColor="@color/gray" />
android:textColor="@color/black"
android:layout_marginBottom="20dp"/>
<ImageView
android:id="@+id/backup_seeed_imageview_warning"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentStart="true"
android:layout_marginLeft="35dp"
android:layout_alignTop="@+id/backup_seed_textview_leyend_backup"
android:background="@drawable/warning" />
<TextView
android:id="@+id/backup_seed_textview_leyend_backup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="70dp"
android:textColor="@color/send_strong_orange"
android:layout_marginRight="70dp"
android:text="@string/window_seed_leyend_backup"
android:textSize="14dp"
android:layout_below="@+id/tvBrainKey"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="40dp"
android:layout_marginTop="20dp"
android:layout_below="@+id/backup_seed_textview_leyend_backup"
android:layout_centerHorizontal="true"
android:weightSum="2">
<Button
android:id="@+id/btnOk"
android:layout_weight="1"
android:layout_width="40dp"
android:layout_height="wrap_content"
android:background="@drawable/ok"/>
<Button
android:id="@+id/btnCopy"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:text="@string/window_seed_copy"
android:textColor="@color/black" />
</LinearLayout> </LinearLayout>
<TextView
android:id="@+id/backup_seed_textview_leyend_backup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearlayout1"
android:layout_marginTop="35dp"
android:text="@string/window_seed_leyend_backup"
android:textColor="@color/black"
android:textSize="14dp" />
<Button
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/backup_seed_textview_leyend_backup"
android:layout_marginLeft="20dp"
android:layout_marginTop="35dp"
android:layout_toLeftOf="@+id/btnCopy"
android:text="@string/cancel"
android:textColor="#0099ff"
android:background="?android:attr/selectableItemBackground"/>
<Button
android:id="@+id/btnCopy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/backup_seed_textview_leyend_backup"
android:layout_marginTop="35dp"
android:text="@string/window_seed_copy"
android:textColor="#0099ff"
android:background="?android:attr/selectableItemBackground"/>
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>