Created AccountsSettingsFragment

This commit is contained in:
Severiano Jaramillo 2018-01-16 11:05:53 -06:00
parent 132c7f1a29
commit 312de0f74b
4 changed files with 186 additions and 1 deletions

View file

@ -17,6 +17,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.AccountsSettingsFragment;
import cy.agorise.crystalwallet.fragments.BackupsSettingsFragment; import cy.agorise.crystalwallet.fragments.BackupsSettingsFragment;
import cy.agorise.crystalwallet.fragments.BalanceFragment; import cy.agorise.crystalwallet.fragments.BalanceFragment;
import cy.agorise.crystalwallet.fragments.GeneralSettingsFragment; import cy.agorise.crystalwallet.fragments.GeneralSettingsFragment;
@ -93,7 +94,7 @@ public class SettingsActivity extends AppCompatActivity{
case 2: case 2:
return new BackupsSettingsFragment(); return new BackupsSettingsFragment();
case 3: case 3:
return new BalanceFragment(); return new AccountsSettingsFragment();
} }

View file

@ -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;
}
}

View file

@ -0,0 +1,110 @@
<?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/tvUpgrade"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_marginTop="32dp"
android:text="@string/upgrade_description"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<Button
android:id="@+id/btnUpgrade"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/upgrade"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@id/tvUpgrade"
app:layout_constraintStart_toStartOf="@id/tvUpgrade" />
<TextView
android:id="@+id/tvImport"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/import_description"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="@id/tvUpgrade"
app:layout_constraintTop_toBottomOf="@id/btnUpgrade"
app:layout_constraintEnd_toEndOf="@id/tvUpgrade"/>
<Button
android:id="@+id/btnImport"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/import_"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@id/tvImport"
app:layout_constraintStart_toStartOf="@id/btnUpgrade" />
<TextView
android:id="@+id/tvRefresh"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/refresh_description"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="@id/tvImport"
app:layout_constraintTop_toBottomOf="@id/btnImport"
app:layout_constraintEnd_toEndOf="@id/tvImport"/>
<Button
android:id="@+id/btnRefresh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/refresh"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/colorPrimary"
app:layout_constraintTop_toBottomOf="@id/tvRefresh"
app:layout_constraintStart_toStartOf="@id/btnImport" />
<TextView
android:id="@+id/tvRemove"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/remove_description"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="@id/tvRefresh"
app:layout_constraintTop_toBottomOf="@id/btnRefresh"
app:layout_constraintEnd_toEndOf="@id/tvRefresh"/>
<Button
android:id="@+id/btnRemove"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:text="@string/remove"
android:textStyle="bold"
android:textColor="@color/white"
android:background="@color/redcolor"
app:layout_constraintTop_toBottomOf="@id/tvRemove"
app:layout_constraintStart_toStartOf="@id/btnRefresh" />
</android.support.constraint.ConstraintLayout>

View file

@ -478,4 +478,12 @@
<string name="wif_key_description">WIF Key (Advanced). A long string of cryptic text that can be used with other Wallets.</string> <string name="wif_key_description">WIF Key (Advanced). A long string of cryptic text that can be used with other Wallets.</string>
<string name="create_a_backup">CREATE A BACKUP</string> <string name="create_a_backup">CREATE A BACKUP</string>
<string name="view_and_copy"><![CDATA[View & Copy]]></string> <string name="view_and_copy"><![CDATA[View & Copy]]></string>
<string name="upgrade_description">Upgrade to LifeTime Membership (LTM). Bitshares\' LTM accounts pay near-zero fees, get 80% cashback and bonuses for referrals.</string>
<string name="upgrade">Upgrade</string>
<string name="import_description">Import Accounts. Import multiple accounts from blockchains such as Bitshares, Bitcoin, Steem, Dash and more.</string>
<string name="import_">Import</string>
<string name="refresh_description">Refresh keys. Ony for bithsares accounts.</string>
<string name="refresh">Refresh</string>
<string name="remove_description">Remove an account from this Wallet. The account removed will still reside on the blockchain.</string>
<string name="remove">Remove</string>
</resources> </resources>