From 4bec1dad847eb89549f4bcfbbd628913e6c1a5f2 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 11 Jan 2018 22:30:45 -0600 Subject: [PATCH] Created BackupsSettingFragment layout --- .../activities/SettingsActivity.java | 6 +- .../fragments/BackupsSettingsFragment.java | 62 ++++++++++++++ .../res/layout/fragment_backups_settings.xml | 82 +++++++++++++++++++ app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/strings.xml | 3 + 5 files changed, 150 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/cy/agorise/crystalwallet/fragments/BackupsSettingsFragment.java create mode 100644 app/src/main/res/layout/fragment_backups_settings.xml diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/SettingsActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/SettingsActivity.java index 54c7368..e90f86e 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/SettingsActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/SettingsActivity.java @@ -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(); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/BackupsSettingsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/BackupsSettingsFragment.java new file mode 100644 index 0000000..7d8349e --- /dev/null +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/BackupsSettingsFragment.java @@ -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; + } +} diff --git a/app/src/main/res/layout/fragment_backups_settings.xml b/app/src/main/res/layout/fragment_backups_settings.xml new file mode 100644 index 0000000..569a63c --- /dev/null +++ b/app/src/main/res/layout/fragment_backups_settings.xml @@ -0,0 +1,82 @@ + + + + + +