Improve create/modify contact UI
This commit is contained in:
parent
bd0bbfa802
commit
3008415316
11 changed files with 152 additions and 480 deletions
|
@ -4,15 +4,14 @@ import android.arch.lifecycle.LiveData;
|
||||||
import android.arch.lifecycle.Observer;
|
import android.arch.lifecycle.Observer;
|
||||||
import android.arch.lifecycle.ViewModelProviders;
|
import android.arch.lifecycle.ViewModelProviders;
|
||||||
import android.support.annotation.Nullable;
|
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.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.text.Editable;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -33,20 +32,14 @@ import cy.agorise.crystalwallet.views.ContactAddressListAdapter;
|
||||||
|
|
||||||
public class CreateContactActivity extends AppCompatActivity implements UIValidatorListener {
|
public class CreateContactActivity extends AppCompatActivity implements UIValidatorListener {
|
||||||
|
|
||||||
@BindView(R.id.etName)
|
@BindView(R.id.tilName)
|
||||||
EditText etName;
|
TextInputLayout tilName;
|
||||||
@BindView(R.id.tvNameError)
|
@BindView(R.id.tietName)
|
||||||
TextView tvNameError;
|
TextInputEditText tietName;
|
||||||
@BindView(R.id.etEmail)
|
|
||||||
EditText etEmail;
|
|
||||||
@BindView(R.id.tvEmailError)
|
|
||||||
TextView tvEmailError;
|
|
||||||
@BindView(R.id.btnCancel)
|
@BindView(R.id.btnCancel)
|
||||||
Button btnCancel;
|
Button btnCancel;
|
||||||
@BindView(R.id.btnCreate)
|
@BindView(R.id.btnCreate)
|
||||||
Button btnCreate;
|
Button btnCreate;
|
||||||
@BindView(R.id.btnModify)
|
|
||||||
Button btnModify;
|
|
||||||
@BindView(R.id.rvContactAddresses)
|
@BindView(R.id.rvContactAddresses)
|
||||||
RecyclerView rvContactAddresses;
|
RecyclerView rvContactAddresses;
|
||||||
@BindView(R.id.btnAddAddress)
|
@BindView(R.id.btnAddAddress)
|
||||||
|
@ -59,6 +52,8 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
|
|
||||||
Contact contact;
|
Contact contact;
|
||||||
|
|
||||||
|
long contactId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -71,10 +66,7 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
rvContactAddresses.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
rvContactAddresses.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||||
rvContactAddresses.setAdapter(listAdapter);
|
rvContactAddresses.setAdapter(listAdapter);
|
||||||
|
|
||||||
long contactId = this.getIntent().getLongExtra("CONTACT_ID",-1);
|
contactId = getIntent().getLongExtra("CONTACT_ID",-1);
|
||||||
|
|
||||||
btnCreate.setVisibility(View.GONE);
|
|
||||||
btnModify.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
if (contactId >= 0){
|
if (contactId >= 0){
|
||||||
final ContactViewModel contactViewModel = ViewModelProviders.of(this).get(ContactViewModel.class);
|
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) {
|
public void onChanged(@Nullable Contact contactChanged) {
|
||||||
if (contactChanged != null){
|
if (contactChanged != null){
|
||||||
contact = contactChanged;
|
contact = contactChanged;
|
||||||
etName.setText(contact.getName());
|
tietName.setText(contact.getName());
|
||||||
etEmail.setText(contact.getEmail());
|
|
||||||
|
|
||||||
LiveData<List<ContactAddress>> contactAddresses = contactViewModel.getContactAddresses();
|
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);
|
modifyContactValidator.setListener(thisActivity);
|
||||||
btnModify.setVisibility(View.VISIBLE);
|
btnCreate.setText(R.string.modify);
|
||||||
} else {
|
} else {
|
||||||
//No contact was found, this will exit the activity
|
//No contact was found, this will exit the activity
|
||||||
finish();
|
finish();
|
||||||
|
@ -112,9 +104,9 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
contactAddressList = new ArrayList<ContactAddress>();
|
contactAddressList = new ArrayList<>();
|
||||||
listAdapter.submitList(contactAddressList);
|
listAdapter.submitList(contactAddressList);
|
||||||
createContactValidator = new CreateContactValidator(this.getApplicationContext(),etName,etEmail);
|
createContactValidator = new CreateContactValidator(this.getApplicationContext(),tietName);
|
||||||
createContactValidator.setListener(this);
|
createContactValidator.setListener(this);
|
||||||
|
|
||||||
btnCreate.setVisibility(View.VISIBLE);
|
btnCreate.setVisibility(View.VISIBLE);
|
||||||
|
@ -139,19 +131,12 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnTextChanged(value = R.id.etName,
|
@OnTextChanged(value = R.id.tietName,
|
||||||
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
|
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
|
||||||
void afterContactNameChanged(Editable editable) {
|
void afterContactNameChanged() {
|
||||||
this.validate();
|
this.validate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnTextChanged(value = R.id.etEmail,
|
|
||||||
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
|
|
||||||
void afterEmailChanged(Editable editable) {
|
|
||||||
this.validate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@OnClick(R.id.btnAddAddress)
|
@OnClick(R.id.btnAddAddress)
|
||||||
public void addAddress(){
|
public void addAddress(){
|
||||||
ContactAddress newContactAddress = new ContactAddress();
|
ContactAddress newContactAddress = new ContactAddress();
|
||||||
|
@ -164,11 +149,13 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
this.finish();
|
this.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.btnModify)
|
@OnClick(R.id.btnCreate)
|
||||||
public void modifyContact(){
|
public void createOrModifyContact(){
|
||||||
|
if(contactId >= 0) {
|
||||||
|
// Modifying existing contact
|
||||||
|
|
||||||
if (this.modifyContactValidator.isValid()) {
|
if (this.modifyContactValidator.isValid()) {
|
||||||
this.contact.setName(etName.getText().toString());
|
this.contact.setName(tietName.getText().toString());
|
||||||
this.contact.setEmail(etEmail.getText().toString());
|
|
||||||
this.contact.clearAddresses();
|
this.contact.clearAddresses();
|
||||||
|
|
||||||
for (ContactAddress contactAddress : contactAddressList){
|
for (ContactAddress contactAddress : contactAddressList){
|
||||||
|
@ -182,14 +169,12 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
this.modifyContactValidator.validate();
|
this.modifyContactValidator.validate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
// Creating a new contact
|
||||||
|
|
||||||
@OnClick(R.id.btnCreate)
|
|
||||||
public void createContact(){
|
|
||||||
if (this.createContactValidator.isValid()) {
|
if (this.createContactValidator.isValid()) {
|
||||||
Contact newContact = new Contact();
|
Contact newContact = new Contact();
|
||||||
newContact.setName(etName.getText().toString());
|
newContact.setName(tietName.getText().toString());
|
||||||
newContact.setEmail(etEmail.getText().toString());
|
|
||||||
|
|
||||||
for (ContactAddress contactAddress : contactAddressList){
|
for (ContactAddress contactAddress : contactAddressList){
|
||||||
newContact.addAddress(contactAddress);
|
newContact.addAddress(contactAddress);
|
||||||
|
@ -203,6 +188,7 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onValidationSucceeded(final ValidationField field) {
|
public void onValidationSucceeded(final ValidationField field) {
|
||||||
|
@ -211,10 +197,8 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
activity.runOnUiThread(new Runnable() {
|
activity.runOnUiThread(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
if (field.getView() == etName) {
|
if (field.getView() == tietName) {
|
||||||
tvNameError.setText("");
|
tilName.setError("");
|
||||||
} else if (field.getView() == etEmail) {
|
|
||||||
tvEmailError.setText("");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activity.isValid()){
|
if (activity.isValid()){
|
||||||
|
@ -232,10 +216,8 @@ public class CreateContactActivity extends AppCompatActivity implements UIValida
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (field.getView() == etName) {
|
if (field.getView() == tietName) {
|
||||||
tvNameError.setText(field.getMessage());
|
tilName.setError(field.getMessage());
|
||||||
} else if (field.getView() == etEmail) {
|
|
||||||
tvEmailError.setText(field.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -15,9 +15,8 @@ import cy.agorise.crystalwallet.viewmodels.validators.validationfields.PinValida
|
||||||
|
|
||||||
public class CreateContactValidator extends UIValidator {
|
public class CreateContactValidator extends UIValidator {
|
||||||
|
|
||||||
public CreateContactValidator(Context context, EditText nameEdit, EditText emailEdit){
|
public CreateContactValidator(Context context, EditText nameEdit){
|
||||||
super(context);
|
super(context);
|
||||||
this.addField(new ContactNameValidationField(nameEdit));
|
this.addField(new ContactNameValidationField(nameEdit));
|
||||||
this.addField(new EmailValidationField(emailEdit));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,9 +13,8 @@ import cy.agorise.crystalwallet.viewmodels.validators.validationfields.EmailVali
|
||||||
|
|
||||||
public class ModifyContactValidator extends UIValidator {
|
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);
|
super(context);
|
||||||
this.addField(new ContactNameValidationField(nameEdit, contact));
|
this.addField(new ContactNameValidationField(nameEdit, contact));
|
||||||
this.addField(new EmailValidationField(emailEdit));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
|
@ -1,174 +1,88 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:focusableInTouchMode="true"
|
||||||
android:paddingBottom="0dp"
|
|
||||||
android:paddingLeft="0dp"
|
|
||||||
android:paddingRight="0dp"
|
|
||||||
android:paddingTop="@dimen/activity_vertical_margin">
|
android:paddingTop="@dimen/activity_vertical_margin">
|
||||||
|
|
||||||
<TextView
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/tvName"
|
android:id="@+id/tilName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
android:layout_marginEnd="@dimen/activity_horizontal_margin">
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:text="Contact Name"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<EditText
|
<android.support.design.widget.TextInputEditText
|
||||||
android:id="@+id/etName"
|
android:id="@+id/tietName"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
android:hint="Contact Name"
|
||||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
android:inputType="textPersonName"
|
||||||
android:background="@drawable/edittext_bg"
|
android:maxLines="1"/>
|
||||||
android:maxLines="1"
|
|
||||||
android:textColor="@color/black" />
|
</android.support.design.widget.TextInputLayout>
|
||||||
<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
|
<Button
|
||||||
android:id="@+id/btnAddAddress"
|
android:id="@+id/btnAddAddress"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/rvContactAddresses"
|
android:layout_marginTop="@dimen/spacing_different_topic"
|
||||||
android:text="Add"/>
|
android:text="@string/add"
|
||||||
</RelativeLayout>
|
android:textStyle="bold"
|
||||||
|
style="@style/Widget.AppCompat.Button.Borderless.Colored"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tilName"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
|
|
||||||
<LinearLayout
|
<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"/>
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/rvContactAddresses"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/activity_horizontal_margin"
|
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||||
android:layout_marginRight="@dimen/activity_horizontal_margin"
|
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||||
android:layout_marginTop="10dp"
|
app:layout_constraintTop_toBottomOf="@id/btnAddAddress"
|
||||||
android:gravity="center"
|
tools:listitem="@layout/contact_address_list_item"
|
||||||
android:orientation="horizontal">
|
tools:itemCount="1"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnCancel"
|
android:id="@+id/btnCancel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_marginTop="@dimen/spacing_different_section"
|
||||||
android:layout_margin="10dp"
|
android:layout_marginStart="@dimen/activity_horizontal_margin"
|
||||||
android:background="@color/pink"
|
android:theme="@style/RedButton"
|
||||||
android:text="@string/cancel"
|
android:text="@string/cancel"
|
||||||
android:textColor="@color/white" />
|
app:layout_constraintTop_toBottomOf="@id/rvContactAddresses"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"/>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btnCreate"
|
android:id="@+id/btnCreate"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_marginEnd="@dimen/activity_horizontal_margin"
|
||||||
android:layout_margin="10dp"
|
android:theme="@style/BlueButton"
|
||||||
android:background="@color/green"
|
android:text="Create"
|
||||||
android:padding="10dp"
|
app:layout_constraintTop_toTopOf="@id/btnCancel"
|
||||||
android:text="Create Contact"
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
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>
|
<cy.agorise.crystalwallet.util.BottomStatusBar
|
||||||
|
android:id="@+id/bottomStatusBar"
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@color/white"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@color/black"></LinearLayout>
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
<LinearLayout
|
</android.support.constraint.ConstraintLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="35dp"
|
|
||||||
android:background="@color/bottomBarColor"
|
|
||||||
android:gravity="bottom"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<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>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
|
@ -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>
|
|
|
@ -1,30 +1,19 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:paddingLeft="10dp"
|
|
||||||
android:paddingRight="10dp"
|
|
||||||
android:paddingTop="10dp">
|
android:paddingTop="10dp">
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_alignParentTop="true">
|
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:layout_width="@dimen/icon_size"
|
android:id="@+id/spCryptoNet"
|
||||||
android:layout_height="@dimen/icon_size"
|
android:layout_width="wrap_content"
|
||||||
android:id="@+id/spCryptoNet"/>
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/etAddress"
|
android:id="@+id/etAddress"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toRightOf="@+id/spCryptoNet"
|
android:layout_marginStart="8dp"/>
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
</RelativeLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -106,47 +106,7 @@
|
||||||
android:textStyle="bold"
|
android:textStyle="bold"
|
||||||
app:layout_constraintEnd_toEndOf="@id/tilAccountName"
|
app:layout_constraintEnd_toEndOf="@id/tilAccountName"
|
||||||
app:layout_constraintTop_toTopOf="@id/btnCancel" />
|
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
|
<cy.agorise.crystalwallet.util.BottomStatusBar
|
||||||
android:id="@+id/bottomStatusBar"
|
android:id="@+id/bottomStatusBar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
<dimen name="app_bar_height">140sp</dimen>
|
<dimen name="app_bar_height">140sp</dimen>
|
||||||
<dimen name="fab_margin">16dp</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 -->
|
<!-- Settings -->
|
||||||
<dimen name="icon_size">60dp</dimen>
|
<dimen name="icon_size">60dp</dimen>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -486,7 +486,7 @@
|
||||||
<string name="remove">Remove</string>
|
<string name="remove">Remove</string>
|
||||||
<string name="user_name_password_placeholder">user_name Password</string>
|
<string name="user_name_password_placeholder">user_name Password</string>
|
||||||
<string name="version_placeholder">v1.0</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="current_pin">Current PIN</string>
|
||||||
<string name="new_pin">New PIN</string>
|
<string name="new_pin">New PIN</string>
|
||||||
<string name="confirm_pin">Confirm PIN</string>
|
<string name="confirm_pin">Confirm PIN</string>
|
||||||
|
@ -506,4 +506,6 @@
|
||||||
<string name="import_account_backup">Import Account Backup</string>
|
<string name="import_account_backup">Import Account Backup</string>
|
||||||
<string name="disagree">Disagree</string>
|
<string name="disagree">Disagree</string>
|
||||||
<string name="agree">Agree</string>
|
<string name="agree">Agree</string>
|
||||||
|
<string name="add">Add</string>
|
||||||
|
<string name="modify">Modify</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -63,18 +63,20 @@
|
||||||
<item name="android:textAllCaps">true</item>
|
<item name="android:textAllCaps">true</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="BlueButton" parent="Theme.AppCompat">
|
<style name="BaseButton" parent="Theme.AppCompat">
|
||||||
<item name="colorAccent">@color/colorPrimary</item>
|
<item name="android:textColor">@android:color/white</item>
|
||||||
<item name="colorControlHighlight">@color/colorPrimaryDark</item>
|
|
||||||
<item name="colorButtonNormal">@color/gray</item>
|
<item name="colorButtonNormal">@color/gray</item>
|
||||||
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
|
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
|
||||||
</style>
|
</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="colorAccent">@color/red</item>
|
||||||
<item name="colorControlHighlight">@color/redColor</item>
|
<item name="colorControlHighlight">@color/redColor</item>
|
||||||
<item name="colorButtonNormal">@color/gray</item>
|
|
||||||
<item name="android:buttonStyle">@style/Widget.AppCompat.Button.Colored</item>
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<!-- Text styles -->
|
<!-- Text styles -->
|
||||||
|
|
Loading…
Reference in a new issue