Created BackupsSettingFragment layout

This commit is contained in:
Severiano Jaramillo 2018-01-11 22:30:45 -06:00
parent 295a3738d6
commit 2312b667f7
5 changed files with 150 additions and 5 deletions

View file

@ -17,6 +17,7 @@ import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.fragments.BackupsSettingsFragment;
import cy.agorise.crystalwallet.fragments.BalanceFragment;
import cy.agorise.crystalwallet.fragments.GeneralSettingsFragment;
@ -88,12 +89,9 @@ public class SettingsActivity extends AppCompatActivity{
switch (position){
case 0:
return new GeneralSettingsFragment();
/*case 1:
return null;
case 2:
return null;*/
case 1:
case 2:
return new BackupsSettingsFragment();
case 3:
return new BalanceFragment();
}

View file

@ -0,0 +1,62 @@
package cy.agorise.crystalwallet.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import cy.agorise.crystalwallet.R;
/**
* Created by xd on 1/11/18.
*/
public class BackupsSettingsFragment extends Fragment{
public BackupsSettingsFragment() {
// Required empty public constructor
}
public static BackupsSettingsFragment newInstance() {
BackupsSettingsFragment fragment = new BackupsSettingsFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@BindView(R.id.tvBinFile)
public TextView tvBinFile;
@BindView(R.id.tvBrainkey)
public TextView tvBrainkey;
@BindView(R.id.tvWIFKey)
public TextView tvWIFKey;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_backups_settings, container, false);
ButterKnife.bind(this, v);
tvBinFile.setText(makeFirstWordsBold(getResources().getString(R.string.bin_file_description)));
tvBrainkey.setText(makeFirstWordsBold(getResources().getString(R.string.brainkey_description)));
tvWIFKey.setText(makeFirstWordsBold(getResources().getString(R.string.wif_key_description)));
return v;
}
private SpannableStringBuilder makeFirstWordsBold(String str) {
SpannableStringBuilder ssb = new SpannableStringBuilder(str);
ssb.setSpan(new android.text.style.StyleSpan(android.graphics.Typeface.BOLD),
0, str.indexOf('.')+1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
return ssb;
}
}

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvBinFile"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginTop="32dp"
android:text="@string/bin_file_description"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<Button
android:id="@+id/btnBinFile"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:padding="8dp"
android:text="CREATE A BACKUP"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@id/tvBinFile"
app:layout_constraintStart_toStartOf="@id/tvBinFile" />
<TextView
android:id="@+id/tvBrainkey"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/brainkey_description"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="@id/tvBinFile"
app:layout_constraintEnd_toEndOf="@id/tvBinFile"
app:layout_constraintTop_toBottomOf="@id/btnBinFile"/>
<Button
android:id="@+id/btnBrainkey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:padding="8dp"
android:text="View &amp; Copy"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/colorPrimary"
app:layout_constraintStart_toStartOf="@id/btnBinFile"
app:layout_constraintTop_toBottomOf="@id/tvBrainkey"/>
<TextView
android:id="@+id/tvWIFKey"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/wif_key_description"
android:textSize="15dp"
app:layout_constraintTop_toBottomOf="@id/btnBrainkey"
app:layout_constraintStart_toStartOf="@id/tvBrainkey"
app:layout_constraintEnd_toEndOf="@id/tvBrainkey" />
<Button
android:id="@+id/btnWIFKey"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:padding="8dp"
android:text="View &amp; Copy"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/colorPrimary"
app:layout_constraintStart_toStartOf="@id/btnBrainkey"
app:layout_constraintTop_toBottomOf="@id/tvWIFKey"/>
</android.support.constraint.ConstraintLayout>

View file

@ -2,7 +2,7 @@
<resources>
<color name="colorPrimary">#0099d6</color>
<color name="colorPrimaryDark">#0099d6</color>
<color name="colorAccent">#669900</color>
<color name="colorAccent">#0099d6</color>
<color name="gray">#d3d3d3</color>
<color name="darkGray">#686767</color>
<color name="lightGray">#E3E3E3</color>

View file

@ -473,4 +473,7 @@
<string name="go_back_arrow">Go back arrow</string>
<string name="settings2">Settings</string>
<string name="info_icon">Info icon</string>
<string name="bin_file_description">Bin file. Always save your backup .bin file to a secret MicroSD card or USB Stick.</string>
<string name="brainkey_description">Brainkey. Account recovery words that can be captured or copied, but not edited.</string>
<string name="wif_key_description">WIF Key (Advanced). A long string of cryptic text that can be used with other Wallets.</string>
</resources>