Merge pull request #3 from sjaramillo10/master

Add latest animation changes to master
This commit is contained in:
hvarona 2018-01-04 22:28:46 -04:00 committed by GitHub
commit bef004048a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
55 changed files with 2851 additions and 236 deletions

View file

@ -15,6 +15,9 @@ android {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
vectorDrawables {
useSupportLibrary true
}
multiDexEnabled true
}
buildTypes {
@ -49,7 +52,7 @@ dependencies {
compile 'org.tukaani:xz:1.6'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.github.bilthon:graphenej:0.4.6-alpha1'
compile 'com.google.zxing:core:3.3.1';
compile 'com.google.zxing:core:3.3.1'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'

View file

@ -0,0 +1,573 @@
{
"formatVersion": 1,
"database": {
"version": 2,
"identityHash": "6dd1ca39bdde9af2cba2b35413c4975e",
"entities": [
{
"tableName": "account_seed",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `master_seed` TEXT, `type` TEXT)",
"fields": [
{
"fieldPath": "mId",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mName",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mMasterSeed",
"columnName": "master_seed",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "type",
"columnName": "type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "crypto_net_account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `seed_id` INTEGER NOT NULL, `account_index` INTEGER NOT NULL, `crypto_net` TEXT, FOREIGN KEY(`seed_id`) REFERENCES `account_seed`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "mId",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mSeedId",
"columnName": "seed_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mAccountIndex",
"columnName": "account_index",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mCryptoNet",
"columnName": "crypto_net",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_crypto_net_account_id",
"unique": false,
"columnNames": [
"id"
],
"createSql": "CREATE INDEX `index_crypto_net_account_id` ON `${TABLE_NAME}` (`id`)"
},
{
"name": "index_crypto_net_account_seed_id",
"unique": false,
"columnNames": [
"seed_id"
],
"createSql": "CREATE INDEX `index_crypto_net_account_seed_id` ON `${TABLE_NAME}` (`seed_id`)"
},
{
"name": "index_crypto_net_account_seed_id_crypto_net_account_index",
"unique": true,
"columnNames": [
"seed_id",
"crypto_net",
"account_index"
],
"createSql": "CREATE UNIQUE INDEX `index_crypto_net_account_seed_id_crypto_net_account_index` ON `${TABLE_NAME}` (`seed_id`, `crypto_net`, `account_index`)"
}
],
"foreignKeys": [
{
"table": "account_seed",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"seed_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "crypto_coin_transaction",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `date` INTEGER, `is_input` INTEGER NOT NULL, `account_id` INTEGER NOT NULL, `amount` INTEGER NOT NULL, `id_currency` INTEGER NOT NULL, `is_confirmed` INTEGER NOT NULL, `from` TEXT, `to` TEXT, FOREIGN KEY(`account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`id_currency`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "date",
"columnName": "date",
"affinity": "INTEGER",
"notNull": false
},
{
"fieldPath": "isInput",
"columnName": "is_input",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "accountId",
"columnName": "account_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "amount",
"columnName": "amount",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "idCurrency",
"columnName": "id_currency",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isConfirmed",
"columnName": "is_confirmed",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "from",
"columnName": "from",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "to",
"columnName": "to",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_crypto_coin_transaction_account_id",
"unique": false,
"columnNames": [
"account_id"
],
"createSql": "CREATE INDEX `index_crypto_coin_transaction_account_id` ON `${TABLE_NAME}` (`account_id`)"
},
{
"name": "index_crypto_coin_transaction_id_currency",
"unique": false,
"columnNames": [
"id_currency"
],
"createSql": "CREATE INDEX `index_crypto_coin_transaction_id_currency` ON `${TABLE_NAME}` (`id_currency`)"
}
],
"foreignKeys": [
{
"table": "crypto_net_account",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"account_id"
],
"referencedColumns": [
"id"
]
},
{
"table": "crypto_currency",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"id_currency"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "crypto_currency",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `crypto_net` TEXT, `precision` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "mId",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mName",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mCryptoNet",
"columnName": "crypto_net",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mPrecision",
"columnName": "precision",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_crypto_currency_crypto_net_name",
"unique": true,
"columnNames": [
"crypto_net",
"name"
],
"createSql": "CREATE UNIQUE INDEX `index_crypto_currency_crypto_net_name` ON `${TABLE_NAME}` (`crypto_net`, `name`)"
}
],
"foreignKeys": []
},
{
"tableName": "crypto_coin_balance",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `account_id` INTEGER NOT NULL, `crypto_currency_id` INTEGER NOT NULL, `balance` INTEGER NOT NULL, FOREIGN KEY(`account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "mId",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mAccountId",
"columnName": "account_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mCryptoCurrencyId",
"columnName": "crypto_currency_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mBalance",
"columnName": "balance",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_crypto_coin_balance_id",
"unique": false,
"columnNames": [
"id"
],
"createSql": "CREATE INDEX `index_crypto_coin_balance_id` ON `${TABLE_NAME}` (`id`)"
},
{
"name": "index_crypto_coin_balance_account_id",
"unique": false,
"columnNames": [
"account_id"
],
"createSql": "CREATE INDEX `index_crypto_coin_balance_account_id` ON `${TABLE_NAME}` (`account_id`)"
},
{
"name": "index_crypto_coin_balance_account_id_crypto_currency_id",
"unique": true,
"columnNames": [
"account_id",
"crypto_currency_id"
],
"createSql": "CREATE UNIQUE INDEX `index_crypto_coin_balance_account_id_crypto_currency_id` ON `${TABLE_NAME}` (`account_id`, `crypto_currency_id`)"
}
],
"foreignKeys": [
{
"table": "crypto_net_account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"account_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "graphene_account",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`crypto_net_account_id` INTEGER NOT NULL, `account_name` TEXT, `account_id` TEXT, PRIMARY KEY(`crypto_net_account_id`), FOREIGN KEY(`crypto_net_account_id`) REFERENCES `crypto_net_account`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "cryptoNetAccountId",
"columnName": "crypto_net_account_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "account_name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "accountId",
"columnName": "account_id",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"crypto_net_account_id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "crypto_net_account",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"crypto_net_account_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "bitshares_asset",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`crypto_curreny_id` INTEGER NOT NULL, `bitshares_id` TEXT, `asset_type` TEXT, PRIMARY KEY(`crypto_curreny_id`), FOREIGN KEY(`crypto_curreny_id`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE NO ACTION )",
"fields": [
{
"fieldPath": "cryptoCurrencyId",
"columnName": "crypto_curreny_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "bitsharesId",
"columnName": "bitshares_id",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "assetType",
"columnName": "asset_type",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"crypto_curreny_id"
],
"autoGenerate": false
},
"indices": [],
"foreignKeys": [
{
"table": "crypto_currency",
"onDelete": "NO ACTION",
"onUpdate": "NO ACTION",
"columns": [
"crypto_curreny_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "crypto_currency_equivalence",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `from_crypto_currency_id` INTEGER NOT NULL, `to_crypto_currency_id` INTEGER NOT NULL, `value` INTEGER NOT NULL, `last_checked` INTEGER, FOREIGN KEY(`from_crypto_currency_id`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE , FOREIGN KEY(`to_crypto_currency_id`) REFERENCES `crypto_currency`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "fromCurrencyId",
"columnName": "from_crypto_currency_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "toCurrencyId",
"columnName": "to_crypto_currency_id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "value",
"columnName": "value",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "lastChecked",
"columnName": "last_checked",
"affinity": "INTEGER",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_crypto_currency_equivalence_from_crypto_currency_id_to_crypto_currency_id",
"unique": true,
"columnNames": [
"from_crypto_currency_id",
"to_crypto_currency_id"
],
"createSql": "CREATE UNIQUE INDEX `index_crypto_currency_equivalence_from_crypto_currency_id_to_crypto_currency_id` ON `${TABLE_NAME}` (`from_crypto_currency_id`, `to_crypto_currency_id`)"
},
{
"name": "index_crypto_currency_equivalence_from_crypto_currency_id",
"unique": false,
"columnNames": [
"from_crypto_currency_id"
],
"createSql": "CREATE INDEX `index_crypto_currency_equivalence_from_crypto_currency_id` ON `${TABLE_NAME}` (`from_crypto_currency_id`)"
},
{
"name": "index_crypto_currency_equivalence_to_crypto_currency_id",
"unique": false,
"columnNames": [
"to_crypto_currency_id"
],
"createSql": "CREATE INDEX `index_crypto_currency_equivalence_to_crypto_currency_id` ON `${TABLE_NAME}` (`to_crypto_currency_id`)"
}
],
"foreignKeys": [
{
"table": "crypto_currency",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"from_crypto_currency_id"
],
"referencedColumns": [
"id"
]
},
{
"table": "crypto_currency",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"to_crypto_currency_id"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "general_setting",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT, `value` TEXT)",
"fields": [
{
"fieldPath": "mId",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "mName",
"columnName": "name",
"affinity": "TEXT",
"notNull": false
},
{
"fieldPath": "mValue",
"columnName": "value",
"affinity": "TEXT",
"notNull": false
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"6dd1ca39bdde9af2cba2b35413c4975e\")"
]
}
}

View file

@ -8,10 +8,10 @@
android:name="cy.agorise.crystalwallet.application.CrystalApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:label="Crystal"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat">
android:theme="@style/AppTheme">
<activity android:name=".activities.IntroActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@ -19,7 +19,8 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.BoardActivity" >
<activity android:name=".activities.BoardActivity"
android:theme="@style/AppTheme.NoActionBar" > <!-- Dirty trick to avoid toolbar error on balance -->
</activity>
<activity android:name=".activities.AccountSeedsManagementActivity" >
</activity>
@ -31,6 +32,10 @@
</activity>
<activity android:name=".activities.CryptoCoinTransactionReceiptActivity" >
</activity>
<activity android:name=".activities.SettingsActivity"
android:theme="@style/AppTheme.NoActionBar" >
</activity>
<service android:name=".service.CrystalWalletService"
android:exported="false"/>
</application>

View file

@ -1,21 +1,39 @@
package cy.agorise.crystalwallet.activities;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.drawable.AnimationDrawable;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.ImageButton;
import android.widget.ImageView;
import butterknife.BindColor;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.fragments.AccountsFragment;
import cy.agorise.crystalwallet.fragments.BalanceFragment;
import cy.agorise.crystalwallet.fragments.ContactsFragment;
import cy.agorise.crystalwallet.fragments.ReceiveTransactionFragment;
import cy.agorise.crystalwallet.fragments.SendTransactionFragment;
import cy.agorise.crystalwallet.fragments.TransactionsFragment;
/**
@ -27,25 +45,180 @@ public class BoardActivity extends AppCompatActivity {
@BindView(R.id.pager)
public ViewPager mPager;
@BindView(R.id.btnGeneralSettings)
public ImageButton btnGeneralSettings;
//@BindView(R.id.btnGeneralSettings)
//public ImageButton btnGeneralSettings;
@BindView(R.id.fabSend)
public FloatingActionButton fabSend;
@BindView(R.id.fabReceive)
public FloatingActionButton fabReceive;
@BindView(R.id.fabAddContact)
public FloatingActionButton fabAddContact;
public BoardPagerAdapter boardAdapter;
/*
* the id of the account of this crypto net balance. It will be loaded
* when the element is bounded.
*/
long cryptoNetAccountId;
@BindView(R.id.surface_view)
public SurfaceView mSurfaceView;
@BindView(R.id.toolbar_user_img)
public ImageView userImage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.board);
ButterKnife.bind(this);
boardAdapter = new BoardPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(boardAdapter);
//-1 represents a crypto net account not loaded yet
this.cryptoNetAccountId = -1;
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Appbar animation
mSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
//Log.d(TAG,"surfaceCreated");
MediaPlayer mediaPlayer = MediaPlayer.create(BoardActivity.this, R.raw.appbar_background);
mediaPlayer.setDisplay(mSurfaceView.getHolder());
mediaPlayer.setLooping(true);
mediaPlayer.start();
}
@OnClick(R.id.btnGeneralSettings)
public void onBtnGeneralSettingsClick(){
Intent intent = new Intent(this, GeneralSettingsActivity.class);
startActivity(intent);
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
//Log.d(TAG,"surfaceChanged");
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
//Log.d(TAG,"surfaceDestroyed");
}
});
boardAdapter = new BoardPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(boardAdapter);
TabLayout tabLayout = findViewById(R.id.tabs);
mPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mPager));
fabReceive.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
receiveToThisAccount();
}
});
fabSend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
sendFromThisAccount();
}
});
// Hide Add Contact fab, it won't hide until first page changed...
// Convert 72dp to pixels (fab is 56dp in diameter + 16dp margin)
final int fabDistanceToHide = (int) (72 * Resources.getSystem().getDisplayMetrics().density);;
fabAddContact.animate().translationY(fabDistanceToHide)
.setInterpolator(new LinearInterpolator()).start();
// Hide and show respective fabs when convenient
mPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
switch (position) {
case 0:
fabReceive.show();
fabSend.show();
fabAddContact.animate().translationY(fabDistanceToHide)
.setInterpolator(new LinearInterpolator()).start();
break;
case 1:
fabReceive.show();
fabSend.show();
fabAddContact.animate().translationY(fabDistanceToHide)
.setInterpolator(new LinearInterpolator()).start();
break;
default:
fabReceive.hide();
fabSend.hide();
fabAddContact.animate().translationY(0)
.setInterpolator(new LinearInterpolator()).start();
break;
}
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
/*
* dispatch the user to the accounts fragment
*/
@OnClick(R.id.toolbar_user_img)
public void accounts() {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag("AccountsDialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
AccountsFragment newFragment = AccountsFragment.newInstance(this.cryptoNetAccountId);
newFragment.show(ft, "AccountsDialog");
}
/*
* dispatch the user to the receive fragment using this account
*/
public void receiveToThisAccount(){
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag("ReceiveDialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
ReceiveTransactionFragment newFragment = ReceiveTransactionFragment.newInstance(this.cryptoNetAccountId);
newFragment.show(ft, "ReceiveDialog");
}
/*
* dispatch the user to the send fragment using this account
*/
public void sendFromThisAccount(){
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
Fragment prev = getSupportFragmentManager().findFragmentByTag("SendDialog");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
// Create and show the dialog.
SendTransactionFragment newFragment = SendTransactionFragment.newInstance(this.cryptoNetAccountId);
newFragment.show(ft, "SendDialog");
}
private class BoardPagerAdapter extends FragmentStatePagerAdapter {

View file

@ -44,8 +44,8 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
SendTransactionValidator sendTransactionValidator;
@BindView(R.id.etFrom)
EditText etFrom;
/*@BindView(R.id.etFrom)
EditText etFrom;*/
@BindView(R.id.tvFromError)
TextView tvFromError;
@BindView(R.id.etTo)
@ -111,18 +111,18 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
}
});
sendTransactionValidator = new SendTransactionValidator(this.getApplicationContext(), this.cryptoNetAccount, etFrom, etTo, spAsset, etAmount, etMemo);
//sendTransactionValidator = new SendTransactionValidator(this.getApplicationContext(), this.cryptoNetAccount, etFrom, etTo, spAsset, etAmount, etMemo);
sendTransactionValidator.setListener(this);
} else {
this.finish();
}
}
@OnTextChanged(value = R.id.etFrom,
/*@OnTextChanged(value = R.id.etFrom,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterFromChanged(Editable editable) {
this.sendTransactionValidator.validate();
}
}*/
@OnTextChanged(value = R.id.etTo,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
@ -177,9 +177,9 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
activity.runOnUiThread(new Runnable() {
public void run() {
if (field.getView() == etFrom) {
/*if (field.getView() == etFrom) {
tvFromError.setText("");
} else if (field.getView() == etTo){
} else*/ if (field.getView() == etTo){
tvToError.setText("");
} else if (field.getView() == etAmount){
tvAmountError.setText("");
@ -201,9 +201,9 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
@Override
public void onValidationFailed(ValidationField field) {
if (field.getView() == etFrom) {
/*if (field.getView() == etFrom) {
tvFromError.setText(field.getMessage());
} else if (field.getView() == etTo){
} else*/ if (field.getView() == etTo){
tvToError.setText(field.getMessage());
} else if (field.getView() == spAsset){
tvAssetError.setText(field.getMessage());

View file

@ -0,0 +1,115 @@
package cy.agorise.crystalwallet.activities;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.ImageView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.fragments.BalanceFragment;
import cy.agorise.crystalwallet.fragments.GeneralSettingsFragment;
/**
* Created by seven on 12/28/17.
*
*/
public class SettingsActivity extends AppCompatActivity{
@BindView(R.id.ivGoBack)
public ImageView ivGoBack;
@BindView(R.id.pager)
public ViewPager mPager;
public SettingsPagerAdapter settingsPagerAdapter;
@BindView(R.id.surface_view)
public SurfaceView mSurfaceView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
ButterKnife.bind(this);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// Appbar animation
mSurfaceView.getHolder().addCallback(new SurfaceHolder.Callback() {
@Override
public void surfaceCreated(SurfaceHolder surfaceHolder) {
//Log.d(TAG,"surfaceCreated");
MediaPlayer mediaPlayer = MediaPlayer.create(SettingsActivity.this, R.raw.appbar_background);
mediaPlayer.setDisplay(mSurfaceView.getHolder());
mediaPlayer.setLooping(true);
mediaPlayer.start();
}
@Override
public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) {
//Log.d(TAG,"surfaceChanged");
}
@Override
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
//Log.d(TAG,"surfaceDestroyed");
}
});
settingsPagerAdapter = new SettingsPagerAdapter(getSupportFragmentManager());
mPager.setAdapter(settingsPagerAdapter);
TabLayout tabLayout = findViewById(R.id.tabs);
mPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
tabLayout.addOnTabSelectedListener(new TabLayout.ViewPagerOnTabSelectedListener(mPager));
}
private class SettingsPagerAdapter extends FragmentStatePagerAdapter {
SettingsPagerAdapter(FragmentManager fm) {
super(fm);
}
@Override
public Fragment getItem(int position) {
switch (position){
case 0:
return new GeneralSettingsFragment();
/*case 1:
return null;
case 2:
return null;*/
case 1:
case 2:
case 3:
return new BalanceFragment();
}
return null; //new OnConstructionFragment();
}
@Override
public int getCount() {
return 4;
}
}
@OnClick(R.id.ivGoBack)
public void goBack(){
onBackPressed();
}
}

View file

@ -0,0 +1,86 @@
package cy.agorise.crystalwallet.fragments;
import android.app.Dialog;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.activities.GeneralSettingsActivity;
import cy.agorise.crystalwallet.activities.SettingsActivity;
public class AccountsFragment extends DialogFragment {
@BindView(R.id.tvSettings)
TextView tvSettings;
@BindView(R.id.tvClose)
TextView tvClose;
public AccountsFragment() {
// Required empty public constructor
}
public static AccountsFragment newInstance(long cryptoNetAccountId) {
AccountsFragment f = new AccountsFragment();
// Supply num input as an argument.
Bundle args = new Bundle();
args.putLong("CRYPTO_NET_ACCOUNT_ID", cryptoNetAccountId);
f.setArguments(args);
return f;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AccountsTheme);
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.fragment_accounts, null);
ButterKnife.bind(this, view);
return builder.setView(view).create();
}
@Override
public void onResume() {
super.onResume();
// Force dialog fragment to use the full width of the screen
Window dialogWindow = getDialog().getWindow();
assert dialogWindow != null;
dialogWindow.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@OnClick(R.id.tvSettings)
public void onTvSettingsClick(){
dismiss();
Intent intent = new Intent(getActivity(), SettingsActivity.class);
startActivity(intent);
}
@OnClick(R.id.tvClose)
public void cancel(){
this.dismiss();
}
}

View file

@ -0,0 +1,42 @@
package cy.agorise.crystalwallet.fragments;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import cy.agorise.crystalwallet.R;
/**
* Created by xd on 12/28/17.
*/
public class GeneralSettingsFragment extends Fragment {
public GeneralSettingsFragment() {
// Required empty public constructor
}
public static GeneralSettingsFragment newInstance() {
GeneralSettingsFragment fragment = new GeneralSettingsFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_general_settings, container, false);
ButterKnife.bind(this, v);
return v;
}
}

View file

@ -7,14 +7,18 @@ import android.arch.lifecycle.Observer;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.text.Editable;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
@ -26,6 +30,7 @@ import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import butterknife.OnClick;
import cy.agorise.graphenej.Invoice;
import java.util.ArrayList;
import java.util.List;
@ -62,6 +67,8 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
TextView tvAssetError;
@BindView(R.id.ivQrCode)
ImageView ivQrCode;
@BindView(R.id.tvCancel)
TextView tvCancel;
private Button btnShareQrCode;
private Button btnClose;
@ -75,6 +82,8 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
private Invoice invoice;
private ArrayList<LineItem> invoiceItems;
private FloatingActionButton fabReceive;
public static ReceiveTransactionFragment newInstance(long cryptoNetAccountId) {
ReceiveTransactionFragment f = new ReceiveTransactionFragment();
@ -97,8 +106,10 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Receive Assets");
fabReceive = getActivity().findViewById(R.id.fabReceive);
fabReceive.hide();
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.ReceiveTransactionTheme);
//builder.setTitle("Receive Assets");
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.receive_transaction, null);
@ -138,18 +149,18 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
builder.setView(view);
builder.setPositiveButton("Share this QR", new DialogInterface.OnClickListener() {
/*builder.setPositiveButton("Share this QR", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
shareQrCode();
}
});
builder.setNegativeButton("Close", new DialogInterface.OnClickListener() {
});*/
/*builder.setNegativeButton("Close", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
});*/
AlertDialog dialog = builder.create();
@ -166,6 +177,28 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
return dialog;
}
@Override
public void onResume() {
super.onResume();
// Force dialog fragment to use the full width of the screen
Window dialogWindow = getDialog().getWindow();
assert dialogWindow != null;
dialogWindow.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public void onDestroy() {
super.onDestroy();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
fabReceive.show();
}
}, 400);
}
@OnTextChanged(value = R.id.etAmount,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterAmountChanged(Editable editable) {
@ -184,6 +217,11 @@ public class ReceiveTransactionFragment extends DialogFragment implements UIVali
}
}
@OnClick(R.id.tvCancel)
public void cancel(){
this.dismiss();
}
@Override
public void onValidationSucceeded(final ValidationField field) {
final ReceiveTransactionFragment fragment = this;

View file

@ -5,8 +5,10 @@ import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer;
import android.content.DialogInterface;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
@ -15,6 +17,8 @@ import android.text.Editable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.LinearInterpolator;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
@ -44,8 +48,8 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
SendTransactionValidator sendTransactionValidator;
@BindView(R.id.etFrom)
EditText etFrom;
@BindView(R.id.spFrom)
Spinner spFrom;
@BindView(R.id.tvFromError)
TextView tvFromError;
@BindView(R.id.etTo)
@ -64,15 +68,16 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
EditText etMemo;
@BindView(R.id.tvMemoError)
TextView tvMemoError;
//@BindView(R.id.btnSend)
Button btnSend;
//@BindView(R.id.btnCancel)
Button btnCancel;
@BindView(R.id.btnSend)
FloatingActionButton btnSend;
@BindView(R.id.btnCancel)
TextView btnCancel;
private long cryptoNetAccountId;
private CryptoNetAccount cryptoNetAccount;
private GrapheneAccount grapheneAccount;
private CrystalDatabase db;
private FloatingActionButton fabSend;
public static SendTransactionFragment newInstance(long cryptoNetAccountId) {
SendTransactionFragment f = new SendTransactionFragment();
@ -93,8 +98,11 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle("Send");
fabSend = getActivity().findViewById(R.id.fabSend);
fabSend.hide();
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.SendTransactionTheme);
//builder.setTitle("Send");
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.send_transaction, null);
@ -127,84 +135,39 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
spAsset.setAdapter(assetAdapter);
}
});
sendTransactionValidator = new SendTransactionValidator(this.getContext(), this.cryptoNetAccount, etFrom, etTo, spAsset, etAmount, etMemo);
// TODO SendTransactionValidator to accept spFrom
//sendTransactionValidator = new SendTransactionValidator(this.getContext(), this.cryptoNetAccount, spFrom, etTo, spAsset, etAmount, etMemo);
sendTransactionValidator.setListener(this);
etFrom.setText(this.grapheneAccount.getName());
// etFrom.setText(this.grapheneAccount.getName());
}
builder.setView(view);
return builder.setView(view).create();
}
builder.setPositiveButton("Send", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
sendTransaction();
public void onResume() {
super.onResume();
// Force dialog fragment to use the full width of the screen
Window dialogWindow = getDialog().getWindow();
assert dialogWindow != null;
dialogWindow.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
public void onDestroy() {
super.onDestroy();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
fabSend.show();
}
});
AlertDialog dialog = builder.create();
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
btnSend = ((AlertDialog)dialog).getButton(AlertDialog.BUTTON_POSITIVE);
btnCancel = ((AlertDialog)dialog).getButton(AlertDialog.BUTTON_NEGATIVE);
btnSend.setEnabled(false);
}
});
return dialog;
}, 400);
}
/*public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState){
View view = inflater.inflate(R.layout.send_transaction, container, false);
ButterKnife.bind(this, view);
btnSend.setEnabled(false);
this.cryptoNetAccountId = getArguments().getLong("CRYPTO_NET_ACCOUNT_ID",-1);
if (this.cryptoNetAccountId != -1) {
db = CrystalDatabase.getAppDatabase(this.getContext());
this.cryptoNetAccount = db.cryptoNetAccountDao().getById(this.cryptoNetAccountId);
this.grapheneAccount = new GrapheneAccount(this.cryptoNetAccount);
this.grapheneAccount.loadInfo(db.grapheneAccountInfoDao().getByAccountId(this.cryptoNetAccountId));
final LiveData<List<CryptoCoinBalance>> balancesList = db.cryptoCoinBalanceDao().getBalancesFromAccount(cryptoNetAccountId);
balancesList.observe(this, new Observer<List<CryptoCoinBalance>>() {
@Override
public void onChanged(@Nullable List<CryptoCoinBalance> cryptoCoinBalances) {
ArrayList<Long> assetIds = new ArrayList<Long>();
for (CryptoCoinBalance nextBalance : balancesList.getValue()) {
assetIds.add(nextBalance.getCryptoCurrencyId());
}
List<CryptoCurrency> cryptoCurrencyList = db.cryptoCurrencyDao().getByIds(assetIds);
CryptoCurrencyAdapter assetAdapter = new CryptoCurrencyAdapter(getContext(), android.R.layout.simple_spinner_item, cryptoCurrencyList);
spAsset.setAdapter(assetAdapter);
}
});
sendTransactionValidator = new SendTransactionValidator(this.getContext(), this.cryptoNetAccount, etFrom, etTo, spAsset, etAmount, etMemo);
sendTransactionValidator.setListener(this);
etFrom.setText(this.grapheneAccount.getName());
}
return view;
}*/
@OnTextChanged(value = R.id.etFrom,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterFromChanged(Editable editable) {
@OnItemSelected(R.id.spFrom)
public void afterFromSelected(Spinner spinner, int position) {
this.sendTransactionValidator.validate();
}
@ -232,10 +195,10 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
this.sendTransactionValidator.validate();
}
//@OnClick(R.id.btnCancel)
//public void cancel(){
// this.finish();
//}
@OnClick(R.id.btnCancel)
public void cancel(){
this.dismiss();
}
//@OnClick(R.id.btnSend)
public void sendTransaction(){
@ -259,7 +222,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
final SendTransactionFragment fragment = this;
if (field.getView() == etFrom) {
if (field.getView() == spFrom) {
tvFromError.setText("");
} else if (field.getView() == etTo){
tvToError.setText("");
@ -282,7 +245,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
@Override
public void onValidationFailed(ValidationField field) {
if (field.getView() == etFrom) {
if (field.getView() == spFrom) {
tvFromError.setText(field.getMessage());
} else if (field.getView() == etTo){
tvToError.setText(field.getMessage());

View file

@ -0,0 +1,450 @@
package cy.agorise.crystalwallet.util;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.graphics.RectF;
import android.graphics.Shader;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.ImageView;
import cy.agorise.crystalwallet.R;
/**
* Custom ImageView for circular images in Android while maintaining the
* best draw performance and supporting custom borders & selectors.
*/
public class CircularImageView extends ImageView {
// For logging purposes
private static final String TAG = CircularImageView.class.getSimpleName();
// Default property values
private static final boolean SHADOW_ENABLED = false;
private static final float SHADOW_RADIUS = 4f;
private static final float SHADOW_DX = 0f;
private static final float SHADOW_DY = 2f;
private static final int SHADOW_COLOR = Color.BLACK;
// Border & Selector configuration variables
private boolean hasBorder;
private boolean hasSelector;
private boolean isSelected;
private int borderWidth;
private int canvasSize;
private int selectorStrokeWidth;
// Shadow properties
private boolean shadowEnabled;
private float shadowRadius;
private float shadowDx;
private float shadowDy;
private int shadowColor;
// Objects used for the actual drawing
private BitmapShader shader;
private Bitmap image;
private Paint paint;
private Paint paintBorder;
private Paint paintSelectorBorder;
private ColorFilter selectorFilter;
public CircularImageView(Context context) {
this(context, null, R.styleable.CircularImageViewStyle_circularImageViewDefault);
}
public CircularImageView(Context context, AttributeSet attrs) {
this(context, attrs, R.styleable.CircularImageViewStyle_circularImageViewDefault);
}
public CircularImageView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs, defStyleAttr);
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public CircularImageView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
init(context, attrs, defStyleAttr);
}
/**
* Initializes paint objects and sets desired attributes.
* @param context Context
* @param attrs Attributes
* @param defStyle Default Style
*/
private void init(Context context, AttributeSet attrs, int defStyle) {
// Initialize paint objects
paint = new Paint();
paint.setAntiAlias(true);
paintBorder = new Paint();
paintBorder.setAntiAlias(true);
paintBorder.setStyle(Paint.Style.STROKE);
paintSelectorBorder = new Paint();
paintSelectorBorder.setAntiAlias(true);
// Enable software rendering on HoneyComb and up. (needed for shadow)
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
setLayerType(LAYER_TYPE_SOFTWARE, null);
// Load the styled attributes and set their properties
TypedArray attributes = context.obtainStyledAttributes(attrs, R.styleable.CircularImageView, defStyle, 0);
// Check for extra features being enabled
hasBorder = attributes.getBoolean(R.styleable.CircularImageView_civ_border, false);
hasSelector = attributes.getBoolean(R.styleable.CircularImageView_civ_selector, false);
shadowEnabled = attributes.getBoolean(R.styleable.CircularImageView_civ_shadow, SHADOW_ENABLED);
// Set border properties, if enabled
if(hasBorder) {
int defaultBorderSize = (int) (2 * context.getResources().getDisplayMetrics().density + 0.5f);
setBorderWidth(attributes.getDimensionPixelOffset(R.styleable.CircularImageView_civ_borderWidth, defaultBorderSize));
setBorderColor(attributes.getColor(R.styleable.CircularImageView_civ_borderColor, Color.WHITE));
}
// Set selector properties, if enabled
if(hasSelector) {
int defaultSelectorSize = (int) (2 * context.getResources().getDisplayMetrics().density + 0.5f);
setSelectorColor(attributes.getColor(R.styleable.CircularImageView_civ_selectorColor, Color.TRANSPARENT));
setSelectorStrokeWidth(attributes.getDimensionPixelOffset(R.styleable.CircularImageView_civ_selectorStrokeWidth, defaultSelectorSize));
setSelectorStrokeColor(attributes.getColor(R.styleable.CircularImageView_civ_selectorStrokeColor, Color.BLUE));
}
// Set shadow properties, if enabled
if(shadowEnabled) {
shadowRadius = attributes.getFloat(R.styleable.CircularImageView_civ_shadowRadius, SHADOW_RADIUS);
shadowDx = attributes.getFloat(R.styleable.CircularImageView_civ_shadowDx, SHADOW_DX);
shadowDy = attributes.getFloat(R.styleable.CircularImageView_civ_shadowDy, SHADOW_DY);
shadowColor = attributes.getColor(R.styleable.CircularImageView_civ_shadowColor, SHADOW_COLOR);
setShadowEnabled(true);
}
// We no longer need our attributes TypedArray, give it back to cache
attributes.recycle();
}
/**
* Sets the CircularImageView's border width in pixels.
* @param borderWidth Width in pixels for the border.
*/
public void setBorderWidth(int borderWidth) {
this.borderWidth = borderWidth;
if(paintBorder != null)
paintBorder.setStrokeWidth(borderWidth);
requestLayout();
invalidate();
}
/**
* Sets the CircularImageView's basic border color.
* @param borderColor The new color (including alpha) to set the border.
*/
public void setBorderColor(int borderColor) {
if (paintBorder != null)
paintBorder.setColor(borderColor);
this.invalidate();
}
/**
* Sets the color of the selector to be draw over the
* CircularImageView. Be sure to provide some opacity.
* @param selectorColor The color (including alpha) to set for the selector overlay.
*/
public void setSelectorColor(int selectorColor) {
this.selectorFilter = new PorterDuffColorFilter(selectorColor, PorterDuff.Mode.SRC_ATOP);
this.invalidate();
}
/**
* Sets the stroke width to be drawn around the CircularImageView
* during click events when the selector is enabled.
* @param selectorStrokeWidth Width in pixels for the selector stroke.
*/
public void setSelectorStrokeWidth(int selectorStrokeWidth) {
this.selectorStrokeWidth = selectorStrokeWidth;
this.requestLayout();
this.invalidate();
}
/**
* Sets the stroke color to be drawn around the CircularImageView
* during click events when the selector is enabled.
* @param selectorStrokeColor The color (including alpha) to set for the selector stroke.
*/
public void setSelectorStrokeColor(int selectorStrokeColor) {
if (paintSelectorBorder != null)
paintSelectorBorder.setColor(selectorStrokeColor);
this.invalidate();
}
/**
* Enables a dark shadow for this CircularImageView.
* @param enabled Set to true to draw a shadow or false to disable it.
*/
public void setShadowEnabled(boolean enabled) {
shadowEnabled = enabled;
updateShadow();
}
/**
* Enables a dark shadow for this CircularImageView.
* If the radius is set to 0, the shadow is removed.
* @param radius Radius for the shadow to extend to.
* @param dx Horizontal shadow offset.
* @param dy Vertical shadow offset.
* @param color The color of the shadow to apply.
*/
public void setShadow(float radius, float dx, float dy, int color) {
shadowRadius = radius;
shadowDx = dx;
shadowDy = dy;
shadowColor = color;
updateShadow();
}
@Override
public void onDraw(Canvas canvas) {
// Don't draw anything without an image
if(image == null)
return;
// Nothing to draw (Empty bounds)
if(image.getHeight() == 0 || image.getWidth() == 0)
return;
// Update shader if canvas size has changed
int oldCanvasSize = canvasSize;
canvasSize = getWidth() < getHeight() ? getWidth() : getHeight();
if(oldCanvasSize != canvasSize)
updateBitmapShader();
// Apply shader to paint
paint.setShader(shader);
// Keep track of selectorStroke/border width
int outerWidth = 0;
// Get the exact X/Y axis of the view
int center = canvasSize / 2;
if(hasSelector && isSelected) { // Draw the selector stroke & apply the selector filter, if applicable
outerWidth = selectorStrokeWidth;
center = (canvasSize - (outerWidth * 2)) / 2;
paint.setColorFilter(selectorFilter);
canvas.drawCircle(center + outerWidth, center + outerWidth, ((canvasSize - (outerWidth * 2)) / 2) + outerWidth - 4.0f, paintSelectorBorder);
}
else if(hasBorder) { // If no selector was drawn, draw a border and clear the filter instead... if enabled
outerWidth = borderWidth;
center = (canvasSize - (outerWidth * 2)) / 2;
paint.setColorFilter(null);
RectF rekt = new RectF(0 + outerWidth / 2, 0 + outerWidth / 2, canvasSize - outerWidth / 2, canvasSize - outerWidth / 2);
canvas.drawArc(rekt, 360, 360, false, paintBorder);
//canvas.drawCircle(center + outerWidth, center + outerWidth, ((canvasSize - (outerWidth * 2)) / 2) + outerWidth - 4.0f, paintBorder);
}
else // Clear the color filter if no selector nor border were drawn
paint.setColorFilter(null);
// Draw the circular image itself
canvas.drawCircle(center + outerWidth, center + outerWidth, ((canvasSize - (outerWidth * 2)) / 2), paint);
}
@Override
public boolean dispatchTouchEvent(MotionEvent event) {
// Check for clickable state and do nothing if disabled
if(!this.isClickable()) {
this.isSelected = false;
return super.onTouchEvent(event);
}
// Set selected state based on Motion Event
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
this.isSelected = true;
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_SCROLL:
case MotionEvent.ACTION_OUTSIDE:
case MotionEvent.ACTION_CANCEL:
this.isSelected = false;
break;
}
// Redraw image and return super type
this.invalidate();
return super.dispatchTouchEvent(event);
}
@Override
public void setImageURI(Uri uri) {
super.setImageURI(uri);
// Extract a Bitmap out of the drawable & set it as the main shader
image = drawableToBitmap(getDrawable());
if(canvasSize > 0)
updateBitmapShader();
}
@Override
public void setImageResource(int resId) {
super.setImageResource(resId);
// Extract a Bitmap out of the drawable & set it as the main shader
image = drawableToBitmap(getDrawable());
if(canvasSize > 0)
updateBitmapShader();
}
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
// Extract a Bitmap out of the drawable & set it as the main shader
image = drawableToBitmap(getDrawable());
if(canvasSize > 0)
updateBitmapShader();
}
@Override
public void setImageBitmap(Bitmap bm) {
super.setImageBitmap(bm);
// Extract a Bitmap out of the drawable & set it as the main shader
image = bm;
if(canvasSize > 0)
updateBitmapShader();
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int width = measureWidth(widthMeasureSpec);
int height = measureHeight(heightMeasureSpec);
setMeasuredDimension(width, height);
}
private int measureWidth(int measureSpec) {
int result;
int specMode = MeasureSpec.getMode(measureSpec);
int specSize = MeasureSpec.getSize(measureSpec);
if (specMode == MeasureSpec.EXACTLY) {
// The parent has determined an exact size for the child.
result = specSize;
}
else if (specMode == MeasureSpec.AT_MOST) {
// The child can be as large as it wants up to the specified size.
result = specSize;
}
else {
// The parent has not imposed any constraint on the child.
result = canvasSize;
}
return result;
}
private int measureHeight(int measureSpecHeight) {
int result;
int specMode = MeasureSpec.getMode(measureSpecHeight);
int specSize = MeasureSpec.getSize(measureSpecHeight);
if (specMode == MeasureSpec.EXACTLY) {
// We were told how big to be
result = specSize;
} else if (specMode == MeasureSpec.AT_MOST) {
// The child can be as large as it wants up to the specified size.
result = specSize;
} else {
// Measure the text (beware: ascent is a negative number)
result = canvasSize;
}
return (result + 2);
}
// TODO: Update shadow layers based on border/selector state and visibility.
private void updateShadow() {
float radius = shadowEnabled ? shadowRadius : 0;
//paint.setShadowLayer(radius, shadowDx, shadowDy, shadowColor);
paintBorder.setShadowLayer(radius, shadowDx, shadowDy, shadowColor);
paintSelectorBorder.setShadowLayer(radius, shadowDx, shadowDy, shadowColor);
}
/**
* Convert a drawable object into a Bitmap.
* @param drawable Drawable to extract a Bitmap from.
* @return A Bitmap created from the drawable parameter.
*/
public Bitmap drawableToBitmap(Drawable drawable) {
if (drawable == null) // Don't do anything without a proper drawable
return null;
else if (drawable instanceof BitmapDrawable) { // Use the getBitmap() method instead if BitmapDrawable
Log.i(TAG, "Bitmap drawable!");
return ((BitmapDrawable) drawable).getBitmap();
}
int intrinsicWidth = drawable.getIntrinsicWidth();
int intrinsicHeight = drawable.getIntrinsicHeight();
if (!(intrinsicWidth > 0 && intrinsicHeight > 0))
return null;
try {
// Create Bitmap object out of the drawable
Bitmap bitmap = Bitmap.createBitmap(intrinsicWidth, intrinsicHeight, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
drawable.draw(canvas);
return bitmap;
} catch (OutOfMemoryError e) {
// Simply return null of failed bitmap creations
Log.e(TAG, "Encountered OutOfMemoryError while generating bitmap!");
return null;
}
}
// TODO TEST REMOVE
public void setIconModeEnabled(boolean e) {}
/**
* Re-initializes the shader texture used to fill in
* the Circle upon drawing.
*/
public void updateBitmapShader() {
if (image == null)
return;
shader = new BitmapShader(image, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
if(canvasSize != image.getWidth() || canvasSize != image.getHeight()) {
Matrix matrix = new Matrix();
float scale = (float) canvasSize / (float) image.getWidth();
matrix.setScale(scale, scale);
shader.setLocalMatrix(matrix);
}
}
/**
* @return Whether or not this view is currently
* in its selected state.
*/
public boolean isSelected() {
return this.isSelected;
}
}

View file

@ -84,7 +84,7 @@ public class CryptoNetBalanceListView extends RelativeLayout {
this.listView.setNestedScrollingEnabled(false);
}
/*
/*main_content
* Sets the data for the list of balances.
*
* @param data the list of crypto net balances that will be show to the user

View file

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/bounce_interpolator"
android:fromXScale="1.0"
android:toXScale="1.0"
android:fromYScale="0.0"
android:toYScale="1.0"
android:fillAfter="true"
android:duration="400"
android:pivotX = "0%"
android:pivotY = "0%"
/>
</set>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/linear_interpolator" >
<scale
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale="100%"
android:fromYScale="100%"
android:toXScale="50%"
android:toYScale="50%"
android:duration="300" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.5"
android:duration="300"/>
</set>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/overshoot_interpolator"
android:startOffset="400">
<translate
android:fromXDelta="-150%"
android:toXDelta="0%"
android:startOffset="0"
android:duration="350" />
<translate
android:fromYDelta="150%"
android:toYDelta="0%"
android:startOffset="0"
android:duration="420" />
</set>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<translate
android:interpolator="@android:anim/decelerate_interpolator"
android:fromYDelta="0%"
android:toYDelta="50%"
android:duration="200" />
<translate
android:interpolator="@android:anim/linear_interpolator"
android:fromXDelta="0%"
android:toXDelta="-50%"
android:duration="300" />
<set
android:shareInterpolator="true"
android:interpolator="@android:anim/linear_interpolator" >
<scale
android:pivotX="0%"
android:pivotY="100%"
android:fromXScale="100%"
android:fromYScale="100%"
android:toXScale="50%"
android:toYScale="50%"
android:duration="300" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.5"
android:duration="300"/>
</set>
</set>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/overshoot_interpolator"
android:startOffset="400">
<translate
android:fromXDelta="150%"
android:toXDelta="0%"
android:startOffset="0"
android:duration="350" />
<translate
android:fromYDelta="150%"
android:toYDelta="0%"
android:startOffset="0"
android:duration="420" />
</set>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false" >
<translate
android:interpolator="@android:anim/decelerate_interpolator"
android:fromYDelta="0%"
android:toYDelta="50%"
android:duration="200" />
<translate
android:interpolator="@android:anim/linear_interpolator"
android:fromXDelta="0%"
android:toXDelta="50%"
android:duration="300" />
<set
android:shareInterpolator="true"
android:interpolator="@android:anim/linear_interpolator" >
<scale
android:pivotX="100%"
android:pivotY="100%"
android:fromXScale="100%"
android:fromYScale="100%"
android:toXScale="50%"
android:toYScale="50%"
android:duration="300" />
<alpha
android:fromAlpha="1.0"
android:toAlpha="0.5"
android:duration="300"/>
</set>
</set>

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/lightGray"
android:pathData="M18,14 h-4 v5h-4v-5H5v-4h5V5h4v5h5v4z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFF"
android:pathData="M14,20l10,0, 10,-20z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFF"
android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z" />
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFF"
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/gray"
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="12dp"
android:height="24dp"
android:viewportWidth="12.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/white"
android:pathData="M0,14 h5 l-4,9 l11,-12 h-5 l4,-9 z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF727272"
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM6,10L6,7L4,7v3L1,10v2h3v3h2v-3h3v-2L6,10zM15,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>

View file

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="@color/darkGray"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
</vector>

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="0"
android:startColor="@color/receive_light_green"
android:endColor="@color/receive_strong_green"/>
</shape>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/transparent" />
<corners android:radius="20dp" />
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<corners
android:bottomLeftRadius="100dp"
android:topLeftRadius="100dp" />
<solid android:color="#FFCEC8" />
</shape>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:angle="0"
android:startColor="@color/send_light_orange"
android:endColor="@color/send_strong_orange"/>
</shape>

View file

@ -0,0 +1,7 @@
<font-family xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<font android:fontStyle="normal" android:fontWeight="400" android:font="@font/opensans_regular"
app:fontStyle="normal" app:fontWeight="400" app:font="@font/opensans_regular"/>
<font android:fontStyle="italic" android:fontWeight="400" android:font="@font/opensans_italic"
app:fontStyle="italic" app:fontWeight="400" app:font="@font/opensans_italic" />
</font-family>

Binary file not shown.

Binary file not shown.

View file

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true">
</android.support.design.widget.CoordinatorLayout>

View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
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:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.SettingsActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="120dp"
android:fitsSystemWindows="true"
android:background="@color/colorPrimary"
app:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="@color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@+id/toolbar">
<SurfaceView
android:id="@+id/surface_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryTransparent"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/transparent"
android:layout_marginTop="8dp"
app:layout_collapseMode="none"
app:popupTheme="@style/AppTheme.PopupOverlay">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/ivGoBack"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginStart="8dp"
app:srcCompat="@drawable/ic_arrow_back"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:contentDescription="@string/go_back_arrow" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/settings2"
android:textStyle="bold"
android:textColor="@color/gray"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/ivGoBack" />
<ImageView
android:id="@+id/ivInfo"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="24dp"
app:srcCompat="@drawable/ic_info_outline"
android:contentDescription="@string/info_icon"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_collapseMode="pin"
android:animateLayoutChanges="true">
<android.support.design.widget.TabItem
android:id="@+id/tabItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/general" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/security" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/backups" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/accounts" />
</android.support.design.widget.TabLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<!-- change height -->
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>

View file

@ -1,24 +1,162 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<android.support.v4.view.ViewPager
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pager"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activities.BoardActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:background="@color/colorPrimary"
app:theme="@style/AppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="@color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:toolbarId="@+id/toolbar">
<SurfaceView
android:id="@+id/surface_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<RelativeLayout
<View
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimaryTransparent"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/transparent"
android:layout_marginTop="8dp"
app:layout_collapseMode="none"
app:popupTheme="@style/AppTheme.PopupOverlay">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:adjustViewBounds="true"
android:src="@drawable/crystal_logo"
android:contentDescription="@string/crystal_logo"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<cy.agorise.crystalwallet.util.CircularImageView
android:id="@+id/toolbar_user_img"
android:layout_width="?attr/actionBarSize"
android:layout_height="?attr/actionBarSize"
android:layout_marginEnd="32dp"
android:src="@drawable/ken_code_gravatar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="16dp"
android:layout_height="30dp"
app:srcCompat="@drawable/ic_lightning_24dp"
android:contentDescription="@string/lightning_icon"
app:layout_constraintStart_toStartOf="@id/toolbar_user_img"
app:layout_constraintBottom_toBottomOf="@id/toolbar_user_img"/>
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
app:srcCompat="@drawable/ic_arrow_24dp"
android:contentDescription="@string/small_triangle_icon"
app:layout_constraintEnd_toEndOf="@id/toolbar_user_img"
app:layout_constraintBottom_toBottomOf="@id/toolbar_user_img"/>
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_gravity="bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white">
app:layout_collapseMode="pin"
android:animateLayoutChanges="true">
<ImageButton
android:id="@+id/btnGeneralSettings"
<android.support.design.widget.TabItem
android:id="@+id/tabItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:background="@drawable/icon_setting" />
</RelativeLayout>
</RelativeLayout>
android:text="@string/balances" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/transactions" />
<android.support.design.widget.TabItem
android:id="@+id/tabItem3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/contacts" />
</android.support.design.widget.TabLayout>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<!-- change height -->
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabReceive"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_gravity="start|bottom"
android:layout_marginBottom="-125dp"
android:layout_marginStart="-125dp"
app:backgroundTint="@color/white"
app:srcCompat="@drawable/receive_icon" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabSend"
android:layout_width="250dp"
android:layout_height="250dp"
android:layout_gravity="end|bottom"
android:layout_marginBottom="-125dp"
android:layout_marginEnd="-125dp"
app:backgroundTint="@color/white"
app:srcCompat="@drawable/send_icon" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabAddContact"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
android:layout_margin="@dimen/fab_margin"
app:backgroundTint="@color/colorPrimaryDark"
app:srcCompat="@drawable/ic_person_add" />
</android.support.design.widget.CoordinatorLayout>

View file

@ -0,0 +1,144 @@
<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="wrap_content"
android:paddingStart="16dp"
android:paddingEnd="16dp">
<View
android:id="@+id/topView"
android:layout_width="match_parent"
android:background="@color/colorPrimary"
android:layout_height="120dp"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:layout_marginTop="45dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<cy.agorise.crystalwallet.util.CircularImageView
android:id="@+id/user_img"
android:layout_width="90dp"
android:layout_height="90dp"
android:src="@drawable/ken_code_gravatar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<ImageView
android:layout_width="24dp"
android:layout_height="45dp"
app:srcCompat="@drawable/ic_lightning_24dp"
app:layout_constraintStart_toStartOf="@id/user_img"
app:layout_constraintBottom_toBottomOf="@id/user_img"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_name_placeholder"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginTop="20dp"
app:layout_constraintTop_toTopOf="@id/topView"
app:layout_constraintBottom_toBottomOf="@id/topView"
app:layout_constraintStart_toStartOf="@id/topView"
app:layout_constraintEnd_toEndOf="@id/topView"/>
<View
android:id="@+id/secondView"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/lightGray"
app:layout_constraintTop_toBottomOf="@id/topView"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/my_accounts"
android:textColor="@color/darkGray"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginStart="32dp"
app:layout_constraintTop_toTopOf="@id/secondView"
app:layout_constraintStart_toStartOf="@id/secondView"
app:layout_constraintBottom_toBottomOf="@id/secondView"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabAddAccount"
android:layout_width="55dp"
android:layout_height="55dp"
app:fabSize="normal"
app:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/ic_add_24dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="32dp"
app:layout_constraintTop_toTopOf="@id/secondView"
app:layout_constraintEnd_toEndOf="parent" />
<View
android:id="@+id/thirdView"
android:layout_width="match_parent"
android:layout_height="250dp"
android:background="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/secondView"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/dont_have_multiple_accounts"
android:textSize="16sp"
android:textAlignment="center"
android:layout_marginEnd="64dp"
android:layout_marginStart="64dp"
app:layout_constraintEnd_toEndOf="@id/thirdView"
app:layout_constraintStart_toStartOf="@id/thirdView"
app:layout_constraintTop_toTopOf="@id/thirdView"
app:layout_constraintBottom_toBottomOf="@id/thirdView"/>
<View
android:id="@+id/forthView"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/lightGray"
app:layout_constraintTop_toBottomOf="@id/thirdView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<ImageView
android:id="@+id/ivSettings"
android:layout_width="20dp"
android:layout_height="20dp"
app:srcCompat="@drawable/ic_settings_24dp"
android:layout_marginStart="24dp"
app:layout_constraintTop_toTopOf="@id/forthView"
app:layout_constraintBottom_toBottomOf="@id/forthView"
app:layout_constraintStart_toStartOf="@id/forthView"/>
<TextView
android:id="@+id/tvSettings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings"
android:textStyle="bold"
android:layout_marginStart="8dp"
app:layout_constraintStart_toEndOf="@id/ivSettings"
app:layout_constraintTop_toTopOf="@id/forthView"
app:layout_constraintBottom_toBottomOf="@id/forthView"/>
<TextView
android:id="@+id/tvClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/close"
android:textStyle="bold"
android:layout_marginEnd="24dp"
app:layout_constraintEnd_toEndOf="@id/forthView"
app:layout_constraintTop_toTopOf="@id/forthView"
app:layout_constraintBottom_toBottomOf="@id/forthView"/>
</android.support.constraint.ConstraintLayout>

View file

@ -0,0 +1,153 @@
<?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"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/tvBackupAsset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="16dp"
android:text="Backup Asset"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner
android:id="@+id/spBackupAsset"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginEnd="32dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/tvBackupAsset"
app:layout_constraintTop_toBottomOf="@id/tvBackupAsset" />
<View
android:id="@+id/vBackupAsset"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginEnd="32dp"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:background="@color/gray"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/spBackupAsset" />
<TextView
android:id="@+id/tvTaxableCountry"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Taxable Country"
app:layout_constraintTop_toBottomOf="@id/vBackupAsset"
app:layout_constraintStart_toStartOf="@id/tvBackupAsset"/>
<Spinner
android:id="@+id/spTaxableCountry"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@+id/tvTaxableCountry"
app:layout_constraintStart_toStartOf="@id/spBackupAsset"
app:layout_constraintEnd_toEndOf="@id/spBackupAsset"/>
<View
android:id="@+id/vTaxableCountry"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="@color/gray"
app:layout_constraintTop_toBottomOf="@id/spTaxableCountry"
app:layout_constraintStart_toStartOf="@id/vBackupAsset"
app:layout_constraintEnd_toEndOf="@id/vBackupAsset"/>
<TextView
android:id="@+id/tvPreferredLanguage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Preferred Language"
app:layout_constraintStart_toStartOf="@id/tvTaxableCountry"
app:layout_constraintTop_toBottomOf="@id/vTaxableCountry"/>
<Spinner
android:id="@+id/spPreferredLanguage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/tvPreferredLanguage"
app:layout_constraintStart_toStartOf="@id/spTaxableCountry"
app:layout_constraintEnd_toEndOf="@id/spTaxableCountry"/>
<View
android:id="@+id/vPreferredLanguage"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="@color/gray"
app:layout_constraintTop_toBottomOf="@id/spPreferredLanguage"
app:layout_constraintStart_toStartOf="@id/vTaxableCountry"
app:layout_constraintEnd_toEndOf="@id/vTaxableCountry"/>
<TextView
android:id="@+id/tvDisplayDateTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Display Dates and Times as"
app:layout_constraintTop_toBottomOf="@id/vPreferredLanguage"
app:layout_constraintStart_toStartOf="@id/tvPreferredLanguage"/>
<Spinner
android:id="@+id/spDisplayDateTime"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/tvDisplayDateTime"
app:layout_constraintStart_toStartOf="@id/spPreferredLanguage"
app:layout_constraintEnd_toEndOf="@id/spPreferredLanguage"/>
<View
android:id="@+id/vDisplayDateTime"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="@color/gray"
app:layout_constraintTop_toBottomOf="@id/spDisplayDateTime"
app:layout_constraintStart_toStartOf="@id/vPreferredLanguage"
app:layout_constraintEnd_toEndOf="@id/vPreferredLanguage"/>
<TextView
android:id="@+id/tvSound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Funds Received Sound"
app:layout_constraintTop_toBottomOf="@id/vDisplayDateTime"
app:layout_constraintStart_toStartOf="@id/tvDisplayDateTime" />
<Spinner
android:id="@+id/spSound"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
app:layout_constraintTop_toBottomOf="@id/tvSound"
app:layout_constraintStart_toStartOf="@id/spDisplayDateTime"
app:layout_constraintEnd_toEndOf="@id/spDisplayDateTime"/>
<View
android:id="@+id/vSound"
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:background="@color/gray"
app:layout_constraintTop_toBottomOf="@id/spSound"
app:layout_constraintStart_toStartOf="@id/vDisplayDateTime"
app:layout_constraintEnd_toEndOf="@id/vDisplayDateTime"/>
</android.support.constraint.ConstraintLayout>

View file

@ -1,4 +1,4 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v4.widget.NestedScrollView 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"
@ -9,4 +9,4 @@
android:layout_height="wrap_content"
android:id="@+id/vTransactionListView" />
</FrameLayout>
</android.support.v4.widget.NestedScrollView>

View file

@ -1,33 +1,154 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
android:layout_height="wrap_content" >
<View
android:id="@+id/topView"
android:layout_width="match_parent"
android:background="@drawable/receive_transaction_top_view"
android:layout_height="120dp"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:text="@string/receive_assets"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<cy.agorise.crystalwallet.util.CircularImageView
android:id="@+id/gravatar"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/ken_code_gravatar"
android:layout_marginStart="32dp"
android:layout_marginTop="90dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner
android:id="@+id/spTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/gravatar"
app:layout_constraintTop_toTopOf="@id/gravatar" />
<TextView
android:id="@+id/tvFromError"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/spTo"
app:layout_constraintStart_toStartOf="@+id/spTo"
app:layout_constraintTop_toBottomOf="@+id/topView" />
<EditText
android:id="@+id/etAmount"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginStart="24dp"
android:inputType="textMultiLine"
android:textColor="@color/white"
android:textSize="20sp"
android:hint="@string/amount"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gravatar" />
<TextView
android:id="@+id/tvAmountError"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/etAmount"
app:layout_constraintStart_toStartOf="@+id/etAmount"
app:layout_constraintTop_toBottomOf="@+id/etAmount" />
<Spinner
android:id="@+id/spAsset"
android:layout_width="match_parent"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginTop="8dp"
android:gravity="top"
android:inputType="textMultiLine"
android:textColor="@color/white" />
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/etAmount" />
<View
android:id="@+id/viewSpinner"
android:layout_width="0dp"
android:layout_height="3dp"
android:layout_marginTop="5dp"
android:background="@color/gray"
app:layout_constraintEnd_toEndOf="@+id/spAsset"
app:layout_constraintStart_toStartOf="@+id/spAsset"
app:layout_constraintTop_toBottomOf="@id/spAsset" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tvAssetError"
android:textColor="@color/red" />
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/red"
app:layout_constraintBottom_toBottomOf="@+id/tvAmountError"
app:layout_constraintEnd_toEndOf="@+id/spAsset"
app:layout_constraintStart_toStartOf="@+id/spAsset" />
<ImageView
android:id="@+id/ivQrCode"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:contentDescription="@string/qr_code"
android:src="@color/gray"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAmountError" />
<TextView
android:id="@+id/tvShare"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:adjustViewBounds="true"/>
</LinearLayout>
android:layout_marginBottom="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:text="@string/share_this_qr"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivQrCode" />
<TextView
android:id="@+id/tvCancel"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_marginBottom="24dp"
android:layout_marginEnd="24dp"
android:text="@string/close"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout>

View file

@ -1,105 +1,239 @@
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="1">
android:layout_height="wrap_content">
<View
android:id="@+id/topView"
android:layout_width="match_parent"
android:background="@drawable/send_transaction_top_view"
android:layout_height="120dp"
android:layout_marginEnd="0dp"
android:layout_marginStart="0dp"
android:layout_marginTop="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/from_capital"
android:inputType="textFilter"
android:textSize="15sp" />
<EditText
android:id="@+id/etFrom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textFilter"
android:textColor="@color/white" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tvFromError"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/to_capital"
android:textSize="15sp" />
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:text="@string/title_capital"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<cy.agorise.crystalwallet.util.CircularImageView
android:id="@+id/gravatar"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/ken_code_gravatar"
android:layout_marginStart="32dp"
android:layout_marginTop="90dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Spinner
android:id="@+id/spFrom"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/gravatar"
app:layout_constraintTop_toTopOf="@id/gravatar" />
<TextView
android:id="@+id/tvFromError"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/spFrom"
app:layout_constraintStart_toStartOf="@+id/spFrom"
app:layout_constraintTop_toBottomOf="@+id/topView" />
<EditText
android:id="@+id/etTo"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="24dp"
android:gravity="top"
android:inputType="textMultiLine"
android:textColor="@color/white" />
android:textColor="@color/white"
android:textSize="20sp"
android:hint="@string/to_capital"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/gravatar" />
<ImageView
android:id="@+id/ivPeople"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_marginEnd="5dp"
app:srcCompat="@drawable/ic_people"
android:layout_marginBottom="15dp"
app:layout_constraintEnd_toEndOf="@id/etTo"
app:layout_constraintBottom_toBottomOf="@id/etTo"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tvToError"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Asset"
android:textSize="15sp" />
<Spinner
android:id="@+id/spAsset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="top"
android:inputType="textMultiLine"
android:textColor="@color/white" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tvAssetError"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/amount"
android:textSize="15sp" />
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/etTo"
app:layout_constraintStart_toStartOf="@+id/etTo"
app:layout_constraintTop_toBottomOf="@+id/etTo" />
<EditText
android:id="@+id/etAmount"
android:layout_width="match_parent"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="24dp"
android:inputType="textMultiLine"
android:textColor="@color/white"
android:textSize="20sp"
android:hint="@string/amount"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvToError" />
<TextView
android:id="@+id/tvAmountError"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/etAmount"
app:layout_constraintStart_toStartOf="@+id/etAmount"
app:layout_constraintTop_toBottomOf="@+id/etAmount" />
<Spinner
android:id="@+id/spAsset"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginTop="8dp"
android:gravity="top"
android:inputType="textMultiLine"
android:textColor="@color/white" />
android:textColor="@color/white"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/etAmount" />
<View
android:id="@+id/viewSpinner"
android:layout_width="0dp"
android:layout_height="3dp"
android:layout_marginTop="5dp"
android:background="@color/gray"
app:layout_constraintEnd_toEndOf="@+id/spAsset"
app:layout_constraintStart_toStartOf="@+id/spAsset"
app:layout_constraintTop_toBottomOf="@id/spAsset" />
<TextView
android:layout_width="match_parent"
android:id="@+id/tvAssetError"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/tvAmountError"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/memo_capital"
android:textSize="15sp" />
android:textColor="@color/red"
app:layout_constraintBottom_toBottomOf="@+id/tvAmountError"
app:layout_constraintEnd_toEndOf="@+id/spAsset"
app:layout_constraintStart_toStartOf="@+id/spAsset" />
<EditText
android:id="@+id/etMemo"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="top"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:inputType="textMultiLine"
android:textColor="@color/white" />
android:textColor="@color/white"
android:hint="@string/memo_capital"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvAmountError" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tvMemoError"
android:textColor="@color/red" />
<!--<Button
android:id="@+id/btnCancel"
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/cancel">
</Button>
<Button
android:textColor="@color/red"
app:layout_constraintEnd_toEndOf="@+id/etMemo"
app:layout_constraintStart_toStartOf="@+id/etMemo"
app:layout_constraintTop_toBottomOf="@+id/etMemo" />
<TextView
android:id="@+id/tvScan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:layout_marginStart="24dp"
android:text="@string/scan_capital"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMemoError" />
<ImageView
android:id="@+id/ivCamera"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginBottom="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:src="#666"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvScan" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabCloseCamera"
android:layout_width="30dp"
android:layout_height="30dp"
app:fabSize="mini"
android:layout_marginBottom="165dp"
android:layout_marginStart="165dp"
app:backgroundTint="@color/send_strong_orange"
app:srcCompat="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="@+id/ivCamera"
app:layout_constraintStart_toStartOf="@+id/ivCamera" />
<View
android:id="@+id/viewSend"
android:layout_width="120dp"
android:layout_height="140dp"
android:layout_marginEnd="0dp"
android:background="@drawable/send_transaction_send_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/ivCamera" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btnSend"
android:layout_width="match_parent"
android:layout_width="90dp"
android:layout_height="90dp"
android:layout_marginTop="24dp"
app:backgroundTint="@color/send_strong_orange"
app:srcCompat="@drawable/ic_arrow_forward"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/viewSend" />
<TextView
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_capital">
</Button>-->
</LinearLayout>
android:layout_marginBottom="24dp"
android:layout_marginEnd="24dp"
android:text="@string/cancel_capital"
android:textStyle="bold"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout>

Binary file not shown.

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- CircularImageView Custom Styling -->
<declare-styleable name="CircularImageView">
<!-- Whether or not to draw a circular border around the image. -->
<attr name="civ_border" format="boolean"/>
<!-- The color of the border draw around the image. (if enabled) -->
<attr name="civ_borderColor" format="color"/>
<!-- Makes the border this pixels wide. (if enabled) -->
<attr name="civ_borderWidth" format="dimension"/>
<!-- Whether or not to draw a selector on this view upon touch events. -->
<attr name="civ_selector" format="boolean"/>
<!-- The color of the selector draw on top of the image upon touch events. (if enabled) -->
<attr name="civ_selectorColor" format="color"/>
<!-- The color of the selector stroke drawn around the image upon touch events. Be sure to provide some opacity. (if enabled) -->
<attr name="civ_selectorStrokeColor" format="color"/>
<!-- The selector stroke drawn around the image upon touch events this pixels wide. (if enabled) -->
<attr name="civ_selectorStrokeWidth" format="dimension"/>
<!-- Whether or not to draw a shadow around your circular image. -->
<attr name="civ_shadow" format="boolean"/>
<!-- The radius for the shadow to extend to. (if enabled) -->
<attr name="civ_shadowRadius" format="float"/>
<!-- Horizontal shadow offset. (if enabled) -->
<attr name="civ_shadowDx" format="float"/>
<!-- Vertical shadow offset. (if enabled) -->
<attr name="civ_shadowDy" format="float"/>
<!-- The color of the shadow drawn around your circular image. (if enabled) -->
<attr name="civ_shadowColor" format="color"/>
</declare-styleable>
<declare-styleable name="CircularImageViewStyle">
<attr name="circularImageViewDefault" format="reference"/>
</declare-styleable>
</resources>

View file

@ -5,8 +5,11 @@
<color name="colorAccent">#669900</color>
<color name="gray">#d3d3d3</color>
<color name="darkGray">#686767</color>
<color name="lightGray">#E3E3E3</color>
<color name="white">#ffffff</color>
<color name="pink">#f0006b</color>
<color name="transparent">#00ffffff</color>
<color name="colorPrimaryTransparent">#330099d6</color>
<color name="green">#147b00</color>
@ -38,4 +41,8 @@
<color name="color_preloader_end">#ff56a9c7</color>
<color name="QRCodeBlackColor">#000000</color>
<color name="QRCodeWhiteColor">#ffffff</color>
<color name="send_strong_orange">#FF7063</color>
<color name="send_light_orange">#FF9269</color>
<color name="receive_light_green">#52CE84</color>
<color name="receive_strong_green">#4EBB7F</color>
</resources>

View file

@ -6,7 +6,7 @@
<dimen name="tab_padding_bottom">16dp</dimen>
<dimen name="tab_label">14sp</dimen>
<dimen name="custom_tab_layout_height">72dp</dimen>
<dimen name="app_bar_height">70sp</dimen>
<dimen name="app_bar_height">140sp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="text_margin">16dp</dimen>
<dimen name="layout_margin">35sp</dimen>
@ -15,6 +15,7 @@
<dimen name="items_erecipt">70dp</dimen>
<dimen name="items_ereciptDouble">140dp</dimen>
<dimen name="items_ereciptImage">150dp</dimen>
<dimen name="appbar_padding_top">8dp</dimen>
<!-- Dimensions form the transaction list -->
<dimen name="transaction_details_text_size">13sp</dimen>

View file

@ -452,4 +452,25 @@
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="scan_capital">Scan a QR or NFC signal</string>
<string name="cancel_capital">CANCEL</string>
<string name="title_capital">Send Assets</string>
<string name="receive_assets">Receive Assets</string>
<string name="share_this_qr">Share this QR</string>
<string name="close">CLOSE</string>
<string name="user_name_placeholder">user_name</string>
<string name="my_accounts">My Accounts</string>
<string name="dont_have_multiple_accounts">You don\'t have multiple accounts at the moment</string>
<string name="settings">SETTINGS</string>
<string name="qr_code">QR code</string>
<string name="crystal_logo">Crystal Logo</string>
<string name="lightning_icon">Lightning icon</string>
<string name="small_triangle_icon">Small triangle icon</string>
<string name="general">General</string>
<string name="security">Security</string>
<string name="backups">Backups</string>
<string name="accounts">Accounts</string>
<string name="go_back_arrow">Go back arrow</string>
<string name="settings2">Settings</string>
<string name="info_icon">Info icon</string>
</resources>

View file

@ -1,6 +1,5 @@
<resources>
<style name="stylishDialog" parent="android:Theme.Dialog">
<item name="android:windowBackground">@color/whiteColor</item>
<item name="android:textColor">@color/black</item>
@ -13,7 +12,6 @@
</style>
<style name="MyMaterialTheme.Base" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
@ -32,18 +30,20 @@
<item name="android:homeAsUpIndicator">@drawable/back_button_image</item>
<item name="android:dialogTheme">@style/CustomDialog</item>
<item name="android:colorButtonNormal">@color/white</item>
<item name="android:fontFamily">@font/opensans</item>
<item name="fontFamily">@font/opensans</item> <!-- target android sdk versions < 26 and > 14 if theme other than AppCompat -->
</style>
<style name="AppTheme.NoActionBar">
<style name="AppTheme.NoActionBar" parent="AppTheme">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark" >
</style>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="splashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowNoTitle">true</item>
@ -54,6 +54,34 @@
</style>
<style name="CustomDialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowNoTitle">false</item>
<item name="android:windowNoTitle">true</item>
</style>
<style name="SendTransactionTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowAnimationStyle">@style/SendTransactionAnimation.Window</item>
</style>
<style name="SendTransactionAnimation.Window" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/send_transaction_in</item>
<item name="android:windowExitAnimation">@anim/send_transaction_out</item>
</style>
<style name="ReceiveTransactionTheme" parent="Theme.AppCompat.Light.Dialog">
<item name="android:windowAnimationStyle">@style/ReceiveTransactionAnimation.Window</item>
</style>
<style name="ReceiveTransactionAnimation.Window" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/receive_transaction_in</item>
<item name="android:windowExitAnimation">@anim/receive_transaction_out</item>
</style>
<style name="AccountsTheme" parent="Theme.AppCompat.DayNight.Dialog">
<item name="android:windowBackground">@color/transparent</item>
<item name="android:windowAnimationStyle">@style/AccountsAnimation.Window</item>
</style>
<style name="AccountsAnimation.Window" parent="@android:style/Animation.Activity">
<item name="android:windowEnterAnimation">@anim/accounts_in</item>
<item name="android:windowExitAnimation">@anim/accounts_out</item>
</style>
</resources>

View file

@ -3,6 +3,7 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
@ -23,6 +24,7 @@ allprojects {
maven {
url 'http://www.idescout.com/maven/repo/'
}
google()
}
}