Improve create/modify contact UI

This commit is contained in:
Severiano Jaramillo 2018-07-12 10:32:01 -05:00
parent bd0bbfa802
commit 3008415316
11 changed files with 152 additions and 480 deletions

View file

@ -4,15 +4,14 @@ import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer;
import android.arch.lifecycle.ViewModelProviders;
import android.support.annotation.Nullable;
import android.support.design.widget.TextInputEditText;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
@ -33,20 +32,14 @@ import cy.agorise.crystalwallet.views.ContactAddressListAdapter;
public class CreateContactActivity extends AppCompatActivity implements UIValidatorListener {
@BindView(R.id.etName)
EditText etName;
@BindView(R.id.tvNameError)
TextView tvNameError;
@BindView(R.id.etEmail)
EditText etEmail;
@BindView(R.id.tvEmailError)
TextView tvEmailError;
@BindView(R.id.tilName)
TextInputLayout tilName;
@BindView(R.id.tietName)
TextInputEditText tietName;
@BindView(R.id.btnCancel)
Button btnCancel;
@BindView(R.id.btnCreate)
Button btnCreate;
@BindView(R.id.btnModify)
Button btnModify;
@BindView(R.id.rvContactAddresses)
RecyclerView rvContactAddresses;
@BindView(R.id.btnAddAddress)
@ -59,6 +52,8 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
Contact contact;
long contactId;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -71,10 +66,7 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
rvContactAddresses.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
rvContactAddresses.setAdapter(listAdapter);
long contactId = this.getIntent().getLongExtra("CONTACT_ID",-1);
btnCreate.setVisibility(View.GONE);
btnModify.setVisibility(View.GONE);
contactId = getIntent().getLongExtra("CONTACT_ID",-1);
if (contactId >= 0){
final ContactViewModel contactViewModel = ViewModelProviders.of(this).get(ContactViewModel.class);
@ -88,8 +80,7 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
public void onChanged(@Nullable Contact contactChanged) {
if (contactChanged != null){
contact = contactChanged;
etName.setText(contact.getName());
etEmail.setText(contact.getEmail());
tietName.setText(contact.getName());
LiveData<List<ContactAddress>> contactAddresses = contactViewModel.getContactAddresses();
@ -102,9 +93,10 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
}
});
modifyContactValidator = new ModifyContactValidator(thisActivity.getApplicationContext(),contact,etName,etEmail);
modifyContactValidator = new ModifyContactValidator(
thisActivity.getApplicationContext(), contact, tietName);
modifyContactValidator.setListener(thisActivity);
btnModify.setVisibility(View.VISIBLE);
btnCreate.setText(R.string.modify);
} else {
//No contact was found, this will exit the activity
finish();
@ -112,9 +104,9 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
}
});
} else {
contactAddressList = new ArrayList<ContactAddress>();
contactAddressList = new ArrayList<>();
listAdapter.submitList(contactAddressList);
createContactValidator = new CreateContactValidator(this.getApplicationContext(),etName,etEmail);
createContactValidator = new CreateContactValidator(this.getApplicationContext(),tietName);
createContactValidator.setListener(this);
btnCreate.setVisibility(View.VISIBLE);
@ -139,19 +131,12 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
return false;
}
@OnTextChanged(value = R.id.etName,
@OnTextChanged(value = R.id.tietName,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterContactNameChanged(Editable editable) {
void afterContactNameChanged() {
this.validate();
}
@OnTextChanged(value = R.id.etEmail,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterEmailChanged(Editable editable) {
this.validate();
}
@OnClick(R.id.btnAddAddress)
public void addAddress(){
ContactAddress newContactAddress = new ContactAddress();
@ -164,42 +149,43 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
this.finish();
}
@OnClick(R.id.btnModify)
public void modifyContact(){
if (this.modifyContactValidator.isValid()) {
this.contact.setName(etName.getText().toString());
this.contact.setEmail(etEmail.getText().toString());
this.contact.clearAddresses();
for (ContactAddress contactAddress : contactAddressList){
this.contact.addAddress(contactAddress);
}
ContactViewModel contactViewModel = ViewModelProviders.of(this).get(ContactViewModel.class);
if (contactViewModel.modifyContact(this.contact)){
this.finish();
} else {
this.modifyContactValidator.validate();
}
}
}
@OnClick(R.id.btnCreate)
public void createContact(){
if (this.createContactValidator.isValid()) {
Contact newContact = new Contact();
newContact.setName(etName.getText().toString());
newContact.setEmail(etEmail.getText().toString());
public void createOrModifyContact(){
if(contactId >= 0) {
// Modifying existing contact
for (ContactAddress contactAddress : contactAddressList){
newContact.addAddress(contactAddress);
if (this.modifyContactValidator.isValid()) {
this.contact.setName(tietName.getText().toString());
this.contact.clearAddresses();
for (ContactAddress contactAddress : contactAddressList){
this.contact.addAddress(contactAddress);
}
ContactViewModel contactViewModel = ViewModelProviders.of(this).get(ContactViewModel.class);
if (contactViewModel.modifyContact(this.contact)){
this.finish();
} else {
this.modifyContactValidator.validate();
}
}
} else {
// Creating a new contact
ContactViewModel contactViewModel = ViewModelProviders.of(this).get(ContactViewModel.class);
if (contactViewModel.addContact(newContact)){
this.finish();
} else {
createContactValidator.validate();
if (this.createContactValidator.isValid()) {
Contact newContact = new Contact();
newContact.setName(tietName.getText().toString());
for (ContactAddress contactAddress : contactAddressList){
newContact.addAddress(contactAddress);
}
ContactViewModel contactViewModel = ViewModelProviders.of(this).get(ContactViewModel.class);
if (contactViewModel.addContact(newContact)){
this.finish();
} else {
createContactValidator.validate();
}
}
}
}
@ -211,10 +197,8 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
activity.runOnUiThread(new Runnable() {
public void run() {
if (field.getView() == etName) {
tvNameError.setText("");
} else if (field.getView() == etEmail) {
tvEmailError.setText("");
if (field.getView() == tietName) {
tilName.setError("");
}
if (activity.isValid()){
@ -232,10 +216,8 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
@Override
public void run() {
if (field.getView() == etName) {
tvNameError.setText(field.getMessage());
} else if (field.getView() == etEmail) {
tvEmailError.setText(field.getMessage());
if (field.getView() == tietName) {
tilName.setError(field.getMessage());
}
}
});

View file

@ -15,9 +15,8 @@ import cy.agorise.crystalwallet.viewmodels.validators.validationfields.PinValida
public class CreateContactValidator extends UIValidator {
public CreateContactValidator(Context context, EditText nameEdit, EditText emailEdit){
public CreateContactValidator(Context context, EditText nameEdit){
super(context);
this.addField(new ContactNameValidationField(nameEdit));
this.addField(new EmailValidationField(emailEdit));
}
}

View file

@ -13,9 +13,8 @@ import cy.agorise.crystalwallet.viewmodels.validators.validationfields.EmailVali
public class ModifyContactValidator extends UIValidator {
public ModifyContactValidator(Context context, Contact contact, EditText nameEdit, EditText emailEdit){
public ModifyContactValidator(Context context, Contact contact, EditText nameEdit){
super(context);
this.addField(new ContactNameValidationField(nameEdit, contact));
this.addField(new EmailValidationField(emailEdit));
}
}

View file

@ -1,146 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="3"
android:background="@color/white"
tools:context="cy.agorise.crystalwallet.activities.MainActivity">
<LinearLayout android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.3"
android:orientation="vertical"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:layout_alignParentTop="true">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:text="@string/account_create_register_or_import"
android:textSize="15dp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="@string/txt_account_name"
android:textStyle="bold"/>
<EditText
android:id="@+id/etAccountName"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/edittext_bg"
android:maxLines="1"
android:singleLine="true"/>
<TextView
android:id="@+id/tvErrorAccountName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/red"
android:visibility="gone"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:id="@+id/tvPin"
android:text="@string/txt_6_digits_pin"
android:textStyle="bold"/>
<EditText
android:id="@+id/etPin"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/edittext_bg"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:id="@+id/tvPinConfirmation"
android:text="@string/txt_6_digits_pin_confirm"
android:textStyle="bold"/>
<EditText
android:id="@+id/etPinConfirmation"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/edittext_bg"
android:inputType="number"
android:maxLines="1"
android:singleLine="true"/>
<Button
android:id="@+id/btnCreate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="@string/create"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/or"
android:layout_margin="10dp"
android:id="@+id/tvOrAccount" />
<Button
android:id="@+id/tvExistingAccount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/existing_account"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_gravity="bottom"
android:gravity="bottom"
android:layout_alignParentBottom="true"
android:weightSum="1">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_gravity="bottom"
android:background="@color/bottomBarColor"
android:gravity="bottom"
android:orientation="horizontal"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin">
<TextView
android:id="@+id/tvAppVersion"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:background="@color/bottomBarColor"/>
<TextView
android:background="@color/bottomBarColor"
android:id="@+id/tvBlockNumberHead"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"/>
<ImageView
android:id="@+id/ivSocketConnected"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_gravity="center"/>
<ImageView android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_gravity="center"
android:visibility="invisible"
android:src="@drawable/icon_setting"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>

View file

@ -1,174 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:focusableInTouchMode="true"
android:paddingTop="@dimen/activity_vertical_margin">
<TextView
android:id="@+id/tvName"
<android.support.design.widget.TextInputLayout
android:id="@+id/tilName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="10dp"
android:text="Contact Name"
android:textStyle="bold" />
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin">
<EditText
android:id="@+id/etName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:background="@drawable/edittext_bg"
android:maxLines="1"
android:textColor="@color/black" />
<TextView
android:id="@+id/tvNameError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:maxLines="1"
android:textColor="@color/red" />
<TextView
android:id="@+id/tvEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="10dp"
android:text="Email"
android:textStyle="bold" />
<EditText
android:id="@+id/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:background="@drawable/edittext_bg"
android:maxLines="1"
android:textColor="@color/black" />
<TextView
android:id="@+id/tvEmailError"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:maxLines="1"
android:textColor="@color/red" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:id="@+id/rvContactAddresses"
android:layout_width="match_parent"
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>
<Button
android:id="@+id/btnAddAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/rvContactAddresses"
android:text="Add"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="10dp"
android:gravity="center"
android:orientation="horizontal">
<Button
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:background="@color/pink"
android:text="@string/cancel"
android:textColor="@color/white" />
<Button
android:id="@+id/btnCreate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:background="@color/green"
android:padding="10dp"
android:text="Create Contact"
android:textColor="@color/white" />
<Button
android:id="@+id/btnModify"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"
android:background="@color/green"
android:padding="10dp"
android:text="Modify Contact"
android:textColor="@color/white" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="bottom"
android:orientation="vertical">
<LinearLayout
<android.support.design.widget.TextInputEditText
android:id="@+id/tietName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/black"></LinearLayout>
android:hint="Contact Name"
android:inputType="textPersonName"
android:maxLines="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@color/bottomBarColor"
android:gravity="bottom"
android:orientation="horizontal">
</android.support.design.widget.TextInputLayout>
<TextView
android:id="@+id/tvAppVersion_brain_key_activity"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/v_1_0_beta" />
<Button
android:id="@+id/btnAddAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_different_topic"
android:text="@string/add"
android:textStyle="bold"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
app:layout_constraintTop_toBottomOf="@id/tilName"
app:layout_constraintEnd_toEndOf="parent"/>
<TextView
android:id="@+id/tvBlockNumberHead_brain_key_activity"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="@string/block_number" />
<TextView
android:id="@+id/tvCryptoAddresses"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:text="Crypto addresses"
android:textAppearance="@style/TextAppearance.Body1"
android:textStyle="bold"
app:layout_constraintTop_toTopOf="@id/btnAddAddress"
app:layout_constraintStart_toStartOf="parent"/>
<ImageView
android:id="@+id/ivSocketConnected_brain_key_activity"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rvContactAddresses"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
app:layout_constraintTop_toBottomOf="@id/btnAddAddress"
tools:listitem="@layout/contact_address_list_item"
tools:itemCount="1"/>
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:src="@drawable/icon_setting"
android:visibility="invisible" />
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/spacing_different_section"
android:layout_marginStart="@dimen/activity_horizontal_margin"
android:theme="@style/RedButton"
android:text="@string/cancel"
app:layout_constraintTop_toBottomOf="@id/rvContactAddresses"
app:layout_constraintStart_toStartOf="parent"/>
</LinearLayout>
<Button
android:id="@+id/btnCreate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/activity_horizontal_margin"
android:theme="@style/BlueButton"
android:text="Create"
app:layout_constraintTop_toTopOf="@id/btnCancel"
app:layout_constraintEnd_toEndOf="parent"/>
<cy.agorise.crystalwallet.util.BottomStatusBar
android:id="@+id/bottomStatusBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"/>
</android.support.constraint.ConstraintLayout>

View file

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<Button
android:id="@+id/tvImportBrainKey"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="@string/import_brainkey"/>
<Button
android:id="@+id/tvBackup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="@string/import_backup"
android:layout_marginTop="20dp" />
<Button
android:id="@+id/btnWifBackup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="@string/import_wif"
android:layout_marginTop="20dp"/>
</LinearLayout>

View file

@ -1,30 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="wrap_content"
android:orientation="vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:orientation="horizontal"
android:paddingTop="10dp">
<RelativeLayout
<Spinner
android:id="@+id/spCryptoNet"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/etAddress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
android:layout_marginStart="8dp"/>
<Spinner
android:layout_width="@dimen/icon_size"
android:layout_height="@dimen/icon_size"
android:id="@+id/spCryptoNet"/>
<EditText
android:id="@+id/etAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/spCryptoNet"
android:layout_alignParentEnd="true"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>

View file

@ -106,47 +106,7 @@
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="@id/tilAccountName"
app:layout_constraintTop_toTopOf="@id/btnCancel" />
<!--
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@color/bottomBarColor"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:id="@+id/tvAppVersion_brain_key_activity"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:text="@string/v_1_0_beta" />
<TextView
android:id="@+id/tvBlockNumberHead_brain_key_activity"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"
android:gravity="center"
android:text="@string/block_number" />
<ImageView
android:id="@+id/ivSocketConnected_brain_key_activity"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5" />
<ImageView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.5"
android:src="@drawable/icon_setting"
android:visibility="invisible" />
</LinearLayout>
-->
<cy.agorise.crystalwallet.util.BottomStatusBar
android:id="@+id/bottomStatusBar"
android:layout_width="match_parent"

View file

@ -6,6 +6,11 @@
<dimen name="app_bar_height">140sp</dimen>
<dimen name="fab_margin">16dp</dimen>
<!-- Spacing between widgets vertically -->
<dimen name="spacing_same_topic">16dp</dimen>
<dimen name="spacing_different_topic">24dp</dimen>
<dimen name="spacing_different_section">40dp</dimen>
<!-- Settings -->
<dimen name="icon_size">60dp</dimen>
</resources>

View file

@ -486,7 +486,7 @@
<string name="remove">Remove</string>
<string name="user_name_password_placeholder">user_name Password</string>
<string name="version_placeholder">v1.0</string>
<string name="block_number_placeholder">block# 14966596</string>
<string name="block_number_placeholder">block# -----</string>
<string name="current_pin">Current PIN</string>
<string name="new_pin">New PIN</string>
<string name="confirm_pin">Confirm PIN</string>
@ -506,4 +506,6 @@
<string name="import_account_backup">Import Account Backup</string>
<string name="disagree">Disagree</string>
<string name="agree">Agree</string>
<string name="add">Add</string>
<string name="modify">Modify</string>
</resources>

View file

@ -63,18 +63,20 @@
<item name="android:textAllCaps">true</item>
</style>
<style name="BlueButton" parent="Theme.AppCompat">
<item name="colorAccent">@color/colorPrimary</item>
<item name="colorControlHighlight">@color/colorPrimaryDark</item>
<style name="BaseButton" parent="Theme.AppCompat">
<item name="android:textColor">@android:color/white</item>
<item name="colorButtonNormal">@color/gray</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
</style>
<style name="RedButton" parent="Theme.AppCompat">
<style name="BlueButton" parent="BaseButton">
<item name="colorAccent">@color/colorPrimary</item>
<item name="colorControlHighlight">@color/colorPrimaryDark</item>
</style>
<style name="RedButton" parent="BaseButton">
<item name="colorAccent">@color/red</item>
<item name="colorControlHighlight">@color/redColor</item>
<item name="colorButtonNormal">@color/gray</item>
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
</style>
<!-- Text styles -->