Merge branch 'develop' of https://github.com/Agorise/crystal-wallet-android into develop
This commit is contained in:
commit
b9d1065e81
12 changed files with 100 additions and 29 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -13,6 +13,7 @@ bin/
|
||||||
gen/
|
gen/
|
||||||
out/
|
out/
|
||||||
.idea/
|
.idea/
|
||||||
|
tmp/
|
||||||
|
|
||||||
# Gradle files
|
# Gradle files
|
||||||
.gradle/
|
.gradle/
|
||||||
|
|
|
@ -44,6 +44,7 @@ import butterknife.OnClick;
|
||||||
import cy.agorise.crystalwallet.R;
|
import cy.agorise.crystalwallet.R;
|
||||||
import cy.agorise.crystalwallet.fragments.BalanceFragment;
|
import cy.agorise.crystalwallet.fragments.BalanceFragment;
|
||||||
import cy.agorise.crystalwallet.fragments.ContactsFragment;
|
import cy.agorise.crystalwallet.fragments.ContactsFragment;
|
||||||
|
import cy.agorise.crystalwallet.fragments.MerchantsFragment;
|
||||||
import cy.agorise.crystalwallet.fragments.ReceiveTransactionFragment;
|
import cy.agorise.crystalwallet.fragments.ReceiveTransactionFragment;
|
||||||
import cy.agorise.crystalwallet.fragments.SendTransactionFragment;
|
import cy.agorise.crystalwallet.fragments.SendTransactionFragment;
|
||||||
import cy.agorise.crystalwallet.fragments.TransactionsFragment;
|
import cy.agorise.crystalwallet.fragments.TransactionsFragment;
|
||||||
|
@ -356,7 +357,7 @@ public class BoardActivity extends CustomActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Titles of the tabs
|
// Titles of the tabs
|
||||||
int[] tabTitles = {R.string.balances, R.string.transactions, R.string.contacts};
|
int[] tabTitles = {R.string.balances, R.string.transactions, R.string.contacts,R.string.Merchants};
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Fragment getItem(int position) {
|
public Fragment getItem(int position) {
|
||||||
|
@ -367,6 +368,8 @@ public class BoardActivity extends CustomActivity {
|
||||||
return new TransactionsFragment();
|
return new TransactionsFragment();
|
||||||
case 2:
|
case 2:
|
||||||
return new ContactsFragment();
|
return new ContactsFragment();
|
||||||
|
case 3:
|
||||||
|
return new MerchantsFragment();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -380,7 +383,7 @@ public class BoardActivity extends CustomActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getCount() {
|
public int getCount() {
|
||||||
return 3;
|
return 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import io.reactivex.Observable;
|
|
||||||
import okhttp3.Interceptor;
|
import okhttp3.Interceptor;
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
import okhttp3.logging.HttpLoggingInterceptor;
|
import okhttp3.logging.HttpLoggingInterceptor;
|
||||||
|
@ -147,6 +146,7 @@ public abstract class BitsharesFaucetApiGenerator {
|
||||||
private static HttpLoggingInterceptor logging;
|
private static HttpLoggingInterceptor logging;
|
||||||
private static OkHttpClient.Builder clientBuilder;
|
private static OkHttpClient.Builder clientBuilder;
|
||||||
private static Retrofit.Builder builder;
|
private static Retrofit.Builder builder;
|
||||||
|
private static final long TIMEOUT = 30;
|
||||||
|
|
||||||
private static HashMap<Class<?>, Object> Services;
|
private static HashMap<Class<?>, Object> Services;
|
||||||
|
|
||||||
|
@ -184,8 +184,9 @@ public abstract class BitsharesFaucetApiGenerator {
|
||||||
return chain.proceed(request);
|
return chain.proceed(request);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
clientBuilder.readTimeout(5, TimeUnit.MINUTES);
|
clientBuilder.readTimeout(TIMEOUT, TimeUnit.SECONDS)
|
||||||
clientBuilder.connectTimeout(5, TimeUnit.MINUTES);
|
.connectTimeout(TIMEOUT, TimeUnit.SECONDS)
|
||||||
|
.writeTimeout(TIMEOUT,TimeUnit.SECONDS);
|
||||||
OkHttpClient client = clientBuilder.build();
|
OkHttpClient client = clientBuilder.build();
|
||||||
Retrofit retrofit = builder.client(client).build();
|
Retrofit retrofit = builder.client(client).build();
|
||||||
return retrofit.create(serviceClass);
|
return retrofit.create(serviceClass);
|
||||||
|
|
|
@ -573,7 +573,7 @@ public abstract class GrapheneApiGenerator {
|
||||||
public void onError(BaseResponse.Error error) {
|
public void onError(BaseResponse.Error error) {
|
||||||
request.getListener().fail(request.getId());
|
request.getListener().fail(request.getId());
|
||||||
}
|
}
|
||||||
}), BitsharesConstant.EQUIVALENT_URL); //todo change equivalent url for current server url
|
}), CryptoNetManager.getURL(CryptoNet.BITSHARES)); //todo change equivalent url for current server url
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -589,7 +589,7 @@ public abstract class GrapheneApiGenerator {
|
||||||
for(BitsharesAsset quoteAsset : quoteAssets){
|
for(BitsharesAsset quoteAsset : quoteAssets){
|
||||||
WebSocketThread thread = new WebSocketThread(new GetLimitOrders(baseAsset.getBitsharesId(),
|
WebSocketThread thread = new WebSocketThread(new GetLimitOrders(baseAsset.getBitsharesId(),
|
||||||
quoteAsset.getBitsharesId(), 10, new EquivalentValueListener(baseAsset,
|
quoteAsset.getBitsharesId(), 10, new EquivalentValueListener(baseAsset,
|
||||||
quoteAsset,context)), BitsharesConstant.EQUIVALENT_URL); //todo change equivalent url for current server url
|
quoteAsset,context)), CryptoNetManager.getURL(CryptoNet.BITSHARES)); //todo change equivalent url for current server url
|
||||||
thread.start();
|
thread.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,15 +37,8 @@ public class CrystalApplication extends Application {
|
||||||
{
|
{
|
||||||
"wss://de.palmpay.io/ws", // Custom node
|
"wss://de.palmpay.io/ws", // Custom node
|
||||||
"wss://bitshares.nu/ws",
|
"wss://bitshares.nu/ws",
|
||||||
"wss://dexnode.net/ws", // Dallas, USA
|
|
||||||
"wss://bitshares.crypto.fans/ws", // Munich, Germany
|
"wss://bitshares.crypto.fans/ws", // Munich, Germany
|
||||||
"wss://bitshares.openledger.info/ws", // Openledger node
|
"wss://bitshares.openledger.info/ws", // Openledger node
|
||||||
"ws://185.208.208.147:8090" // Custom node
|
|
||||||
};
|
|
||||||
|
|
||||||
public static String BITSHARES_TESTNET_URL[] =
|
|
||||||
{
|
|
||||||
"http://185.208.208.147:11012", // Openledger node
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//This is for testing the equivalent values on the testnet TODO remove
|
//This is for testing the equivalent values on the testnet TODO remove
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package cy.agorise.crystalwallet.dialogs.material
|
||||||
|
|
||||||
|
import android.app.Activity
|
||||||
|
import cy.agorise.crystalwallet.R
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* Class to just call simple loading dialog
|
||||||
|
*
|
||||||
|
* Sumple Use:
|
||||||
|
*
|
||||||
|
* final CrystalLoading crystalLoading = new CrystalLoading(activity);
|
||||||
|
* crystalLoading.show();
|
||||||
|
*
|
||||||
|
* */
|
||||||
|
open class CrystalLoading : CrystalDialog {
|
||||||
|
|
||||||
|
constructor(activity:Activity) : super(activity) {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set loading properties only
|
||||||
|
* */
|
||||||
|
this.progress()
|
||||||
|
this.setText(activity.getString(R.string.loading))
|
||||||
|
}
|
||||||
|
}
|
|
@ -27,9 +27,7 @@ import butterknife.OnClick;
|
||||||
import cy.agorise.crystalwallet.R;
|
import cy.agorise.crystalwallet.R;
|
||||||
import cy.agorise.crystalwallet.activities.BoardActivity;
|
import cy.agorise.crystalwallet.activities.BoardActivity;
|
||||||
import cy.agorise.crystalwallet.activities.ImportSeedActivity;
|
import cy.agorise.crystalwallet.activities.ImportSeedActivity;
|
||||||
import cy.agorise.crystalwallet.activities.IntroActivity;
|
|
||||||
import cy.agorise.crystalwallet.dialogs.material.CrystalDialog;
|
import cy.agorise.crystalwallet.dialogs.material.CrystalDialog;
|
||||||
import cy.agorise.crystalwallet.dialogs.material.DialogMaterial;
|
|
||||||
import cy.agorise.crystalwallet.requestmanagers.FileServiceRequestListener;
|
import cy.agorise.crystalwallet.requestmanagers.FileServiceRequestListener;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.FileServiceRequests;
|
import cy.agorise.crystalwallet.requestmanagers.FileServiceRequests;
|
||||||
import cy.agorise.crystalwallet.requestmanagers.ImportBackupRequest;
|
import cy.agorise.crystalwallet.requestmanagers.ImportBackupRequest;
|
||||||
|
@ -200,7 +198,7 @@ public class ImportAccountOptionsFragment extends DialogFragment {
|
||||||
* Show loading dialog
|
* Show loading dialog
|
||||||
* */
|
* */
|
||||||
crystalDialog = new CrystalDialog((Activity) getContext());
|
crystalDialog = new CrystalDialog((Activity) getContext());
|
||||||
crystalDialog.setText(getContext().getString(R.string.Creating_backup_from_file));
|
crystalDialog.setText(getContext().getString(R.string.Restoring_backup_from_file));
|
||||||
crystalDialog.progress();
|
crystalDialog.progress();
|
||||||
crystalDialog.show();
|
crystalDialog.show();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
package cy.agorise.crystalwallet.fragments;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
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;
|
||||||
|
|
||||||
|
public class MerchantsFragment extends Fragment {
|
||||||
|
|
||||||
|
public MerchantsFragment() {
|
||||||
|
// Required empty public constructor
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MerchantsFragment newInstance() {
|
||||||
|
MerchantsFragment fragment = new MerchantsFragment();
|
||||||
|
Bundle args = new Bundle();
|
||||||
|
fragment.setArguments(args);
|
||||||
|
return fragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
|
||||||
|
Bundle savedInstanceState) {
|
||||||
|
// Inflate the layout for this fragment
|
||||||
|
View view = inflater.inflate(R.layout.fragment_merchants, container, false);
|
||||||
|
ButterKnife.bind(this, view);
|
||||||
|
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,17 +11,8 @@ import cy.agorise.graphenej.models.WitnessResponse;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class BitsharesCryptoNetVerifier extends CryptoNetVerifier {
|
public class BitsharesCryptoNetVerifier extends CryptoNetVerifier {
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO We need to change this to a type of subCryptoNet
|
|
||||||
*/
|
|
||||||
private final CryptoNet cryptoNet = CryptoNet.BITSHARES;
|
private final CryptoNet cryptoNet = CryptoNet.BITSHARES;
|
||||||
/**
|
private final String CHAIN_ID = "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8";//mainnet
|
||||||
* Todo info need to be on the SubCryptoNet
|
|
||||||
*/
|
|
||||||
private final String CHAIN_ID = "9cf6f255a208100d2bb275a3c52f4b1589b7ec9c9bfc2cb2a5fe6411295106d8";//testnet
|
|
||||||
//private final String CHAIN_ID = "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8";//mainnet
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void checkURL(final String url) {
|
public void checkURL(final String url) {
|
||||||
|
|
|
@ -106,6 +106,7 @@
|
||||||
app:tabSelectedTextColor="@color/white"
|
app:tabSelectedTextColor="@color/white"
|
||||||
app:layout_collapseMode="pin"
|
app:layout_collapseMode="pin"
|
||||||
app:tabIndicatorHeight="0dp"
|
app:tabIndicatorHeight="0dp"
|
||||||
|
app:tabMode="scrollable"
|
||||||
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
|
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
|
||||||
app:tabTextColor="@color/lightGrayClear"
|
app:tabTextColor="@color/lightGrayClear"
|
||||||
android:animateLayoutChanges="true" />
|
android:animateLayoutChanges="true" />
|
||||||
|
|
14
app/src/main/res/layout/fragment_merchants.xml
Normal file
14
app/src/main/res/layout/fragment_merchants.xml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context="cy.agorise.crystalwallet.fragments.ContactsFragment">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Comming soon"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:textSize="20dp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
|
@ -279,7 +279,7 @@
|
||||||
<string name="head_block_number">head_block_number</string>
|
<string name="head_block_number">head_block_number</string>
|
||||||
<string name="e_receipt">e_receipt</string>
|
<string name="e_receipt">e_receipt</string>
|
||||||
|
|
||||||
<string name="Creating_backup_from_file">Creating backup from file</string>
|
<string name="Restoring_backup_from_file">Restoring backup from file</string>
|
||||||
|
|
||||||
<string name="folder_name">SmartcoinsWallet</string>
|
<string name="folder_name">SmartcoinsWallet</string>
|
||||||
<string name="login_api">{\"id\":1,\"method\":\"call\",\"params\":[1,\"login\",[\"\",\"\"]]}</string>
|
<string name="login_api">{\"id\":1,\"method\":\"call\",\"params\":[1,\"login\",[\"\",\"\"]]}</string>
|
||||||
|
@ -445,6 +445,8 @@
|
||||||
<string name="please_import_the_correct_file">Please import the correct file</string>
|
<string name="please_import_the_correct_file">Please import the correct file</string>
|
||||||
<string name="merchant_email_has_been_imported_successfully">Merchant email has been imported successfully</string>
|
<string name="merchant_email_has_been_imported_successfully">Merchant email has been imported successfully</string>
|
||||||
|
|
||||||
|
<string name="Merchants">Merchants</string>
|
||||||
|
|
||||||
<!-- Errors -->
|
<!-- Errors -->
|
||||||
<string name="error_with_message">Error: %s</string>
|
<string name="error_with_message">Error: %s</string>
|
||||||
<string name="error_no_message">An error prevented this operation to succeed</string>
|
<string name="error_no_message">An error prevented this operation to succeed</string>
|
||||||
|
@ -516,7 +518,7 @@
|
||||||
<string name="import_account">Import Account</string>
|
<string name="import_account">Import Account</string>
|
||||||
<string name="import_account_options_description">Select one option to import your existing account</string>
|
<string name="import_account_options_description">Select one option to import your existing account</string>
|
||||||
<string name="import_account_seed">Import Account Seed</string>
|
<string name="import_account_seed">Import Account Seed</string>
|
||||||
<string name="import_account_backup">Import Account Backup</string>
|
<string name="import_account_backup">Import .bin File</string>
|
||||||
<string name="disagree">Disagree</string>
|
<string name="disagree">Disagree</string>
|
||||||
<string name="agree">Agree</string>
|
<string name="agree">Agree</string>
|
||||||
<string name="add">Add</string>
|
<string name="add">Add</string>
|
||||||
|
|
Loading…
Reference in a new issue