From 312de0f74be715b4909d7afc5734298b6d4e3f04 Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Tue, 16 Jan 2018 11:05:53 -0600 Subject: [PATCH] Created AccountsSettingsFragment --- .../activities/SettingsActivity.java | 3 +- .../fragments/AccountsSettingsFragment.java | 66 +++++++++++ .../res/layout/fragment_accounts_settings.xml | 110 ++++++++++++++++++ app/src/main/res/values/strings.xml | 8 ++ 4 files changed, 186 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/cy/agorise/crystalwallet/fragments/AccountsSettingsFragment.java create mode 100644 app/src/main/res/layout/fragment_accounts_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 e90f86e..5587815 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.AccountsSettingsFragment; import cy.agorise.crystalwallet.fragments.BackupsSettingsFragment; import cy.agorise.crystalwallet.fragments.BalanceFragment; import cy.agorise.crystalwallet.fragments.GeneralSettingsFragment; @@ -93,7 +94,7 @@ public class SettingsActivity extends AppCompatActivity{ case 2: return new BackupsSettingsFragment(); case 3: - return new BalanceFragment(); + return new AccountsSettingsFragment(); } diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/AccountsSettingsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/AccountsSettingsFragment.java new file mode 100644 index 0000000..5a84c0d --- /dev/null +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/AccountsSettingsFragment.java @@ -0,0 +1,66 @@ +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/16/18. + */ + +public class AccountsSettingsFragment extends Fragment { + public AccountsSettingsFragment() { + // Required empty public constructor + } + + public static AccountsSettingsFragment newInstance() { + AccountsSettingsFragment fragment = new AccountsSettingsFragment(); + Bundle args = new Bundle(); + fragment.setArguments(args); + return fragment; + } + + @BindView(R.id.tvUpgrade) + public TextView tvUpgrade; + + @BindView(R.id.tvImport) + public TextView tvImport; + + @BindView(R.id.tvRefresh) + public TextView tvRefresh; + + @BindView(R.id.tvRemove) + public TextView tvRemove; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // Inflate the layout for this fragment + View v = inflater.inflate(R.layout.fragment_accounts_settings, container, false); + ButterKnife.bind(this, v); + + tvUpgrade.setText(makeFirstWordsBold(getResources().getString(R.string.upgrade_description))); + tvImport.setText(makeFirstWordsBold(getResources().getString(R.string.import_description))); + tvRefresh.setText(makeFirstWordsBold(getResources().getString(R.string.refresh_description))); + tvRemove.setText(makeFirstWordsBold(getResources().getString(R.string.remove_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_accounts_settings.xml b/app/src/main/res/layout/fragment_accounts_settings.xml new file mode 100644 index 0000000..09f053b --- /dev/null +++ b/app/src/main/res/layout/fragment_accounts_settings.xml @@ -0,0 +1,110 @@ + + + + + +