From 10830b964a4339c402e0e0eac5f656020cb7576c Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 18 Sep 2018 12:40:49 -0500 Subject: [PATCH 1/6] The modal says creating backup, when actually you are restoring from a backup. that must be reworded --- .../crystalwallet/fragments/ImportAccountOptionsFragment.java | 4 +--- app/src/main/res/values/strings.xml | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java index 6d3fe60..749a359 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/ImportAccountOptionsFragment.java @@ -27,9 +27,7 @@ import butterknife.OnClick; import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.activities.BoardActivity; 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.DialogMaterial; import cy.agorise.crystalwallet.requestmanagers.FileServiceRequestListener; import cy.agorise.crystalwallet.requestmanagers.FileServiceRequests; import cy.agorise.crystalwallet.requestmanagers.ImportBackupRequest; @@ -202,7 +200,7 @@ public class ImportAccountOptionsFragment extends DialogFragment { * Show loading dialog * */ 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.show(); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e2aabac..bfbdbee 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -279,7 +279,7 @@ head_block_number e_receipt - Creating backup from file + Restoring backup from file SmartcoinsWallet {\"id\":1,\"method\":\"call\",\"params\":[1,\"login\",[\"\",\"\"]]} @@ -445,6 +445,8 @@ Please import the correct file Merchant email has been imported successfully + Merchants + Error: %s An error prevented this operation to succeed From 16dc55a18b198d2e7efa8f4e190fbbf108f30536 Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 18 Sep 2018 12:41:43 -0500 Subject: [PATCH 2/6] Scrollable mode in tablayout lib for board window --- app/src/main/res/layout/board.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/layout/board.xml b/app/src/main/res/layout/board.xml index 01e2db2..d6b6a5d 100644 --- a/app/src/main/res/layout/board.xml +++ b/app/src/main/res/layout/board.xml @@ -106,6 +106,7 @@ app:tabSelectedTextColor="@color/white" app:layout_collapseMode="pin" app:tabIndicatorHeight="0dp" + app:tabMode="scrollable" app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget" app:tabTextColor="@color/lightGrayClear" android:animateLayoutChanges="true" /> From b6a9e6b59c11d253ba41a1be23db1403679b719d Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 18 Sep 2018 12:45:01 -0500 Subject: [PATCH 3/6] =?UTF-8?q?Add=20new=20Tab=20called=20=E2=80=9CMerchan?= =?UTF-8?q?ts=E2=80=9D=20and=20inside=20it=20should=20be=20=E2=80=9CCommin?= =?UTF-8?q?g=20soon=E2=80=9D=20text?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activities/BoardActivity.java | 7 +++- .../dialogs/material/CrystalLoading.kt | 27 +++++++++++++ .../fragments/MerchantsFragment.java | 40 +++++++++++++++++++ .../main/res/layout/fragment_merchants.xml | 14 +++++++ 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 app/src/main/java/cy/agorise/crystalwallet/dialogs/material/CrystalLoading.kt create mode 100644 app/src/main/java/cy/agorise/crystalwallet/fragments/MerchantsFragment.java create mode 100644 app/src/main/res/layout/fragment_merchants.xml diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java index 3d37978..23a3eb9 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/BoardActivity.java @@ -44,6 +44,7 @@ import butterknife.OnClick; import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.fragments.BalanceFragment; import cy.agorise.crystalwallet.fragments.ContactsFragment; +import cy.agorise.crystalwallet.fragments.MerchantsFragment; import cy.agorise.crystalwallet.fragments.ReceiveTransactionFragment; import cy.agorise.crystalwallet.fragments.SendTransactionFragment; import cy.agorise.crystalwallet.fragments.TransactionsFragment; @@ -356,7 +357,7 @@ public class BoardActivity extends CustomActivity { } // 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 public Fragment getItem(int position) { @@ -367,6 +368,8 @@ public class BoardActivity extends CustomActivity { return new TransactionsFragment(); case 2: return new ContactsFragment(); + case 3: + return new MerchantsFragment(); } @@ -380,7 +383,7 @@ public class BoardActivity extends CustomActivity { @Override public int getCount() { - return 3; + return 4; } } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/dialogs/material/CrystalLoading.kt b/app/src/main/java/cy/agorise/crystalwallet/dialogs/material/CrystalLoading.kt new file mode 100644 index 0000000..de8e4f9 --- /dev/null +++ b/app/src/main/java/cy/agorise/crystalwallet/dialogs/material/CrystalLoading.kt @@ -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)) + } +} \ No newline at end of file diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/MerchantsFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/MerchantsFragment.java new file mode 100644 index 0000000..91b6d6e --- /dev/null +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/MerchantsFragment.java @@ -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; + } +} diff --git a/app/src/main/res/layout/fragment_merchants.xml b/app/src/main/res/layout/fragment_merchants.xml new file mode 100644 index 0000000..4ac2d5b --- /dev/null +++ b/app/src/main/res/layout/fragment_merchants.xml @@ -0,0 +1,14 @@ + + + + + From 8a86816c76f4a8b7d9dc4f7dc784858e4c8fe290 Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 18 Sep 2018 13:13:27 -0500 Subject: [PATCH 4/6] Simplify the buttons. the text at the top already says you are importing an account. so the buttons should just say Import .bin File or Import Brainkey in the intro screen --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bfbdbee..caa4ab5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -518,7 +518,7 @@ Import Account Select one option to import your existing account Import Account Seed - Import Account Backup + Import .bin File Disagree Agree Add From c818eaf472726be2543d3d2b25978acd7439846b Mon Sep 17 00:00:00 2001 From: Henry Varona Date: Tue, 18 Sep 2018 15:47:15 -0400 Subject: [PATCH 5/6] - Added wrtie timeout for the faucet request - Change the equivalent url to use the BTS serve - --- .gitignore | 1 + .../apigenerator/BitsharesFaucetApiGenerator.java | 7 ++++--- .../apigenerator/GrapheneApiGenerator.java | 4 ++-- .../crystalwallet/application/CrystalApplication.java | 5 ----- .../network/BitsharesCryptoNetVerifier.java | 11 +---------- 5 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index 8e3836b..28d0bf3 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ bin/ gen/ out/ .idea/ +tmp/ # Gradle files .gradle/ diff --git a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/BitsharesFaucetApiGenerator.java b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/BitsharesFaucetApiGenerator.java index 10c2465..5b2b6d2 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/BitsharesFaucetApiGenerator.java +++ b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/BitsharesFaucetApiGenerator.java @@ -7,7 +7,6 @@ import java.util.HashMap; import java.util.Map; import java.util.concurrent.TimeUnit; -import io.reactivex.Observable; import okhttp3.Interceptor; import okhttp3.OkHttpClient; import okhttp3.logging.HttpLoggingInterceptor; @@ -147,6 +146,7 @@ public abstract class BitsharesFaucetApiGenerator { private static HttpLoggingInterceptor logging; private static OkHttpClient.Builder clientBuilder; private static Retrofit.Builder builder; + private static final long TIMEOUT = 30; private static HashMap, Object> Services; @@ -184,8 +184,9 @@ public abstract class BitsharesFaucetApiGenerator { return chain.proceed(request); } }); - clientBuilder.readTimeout(5, TimeUnit.MINUTES); - clientBuilder.connectTimeout(5, TimeUnit.MINUTES); + clientBuilder.readTimeout(TIMEOUT, TimeUnit.SECONDS) + .connectTimeout(TIMEOUT, TimeUnit.SECONDS) + .writeTimeout(TIMEOUT,TimeUnit.SECONDS); OkHttpClient client = clientBuilder.build(); Retrofit retrofit = builder.client(client).build(); return retrofit.create(serviceClass); diff --git a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java index de1a19e..e393486 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java +++ b/app/src/main/java/cy/agorise/crystalwallet/apigenerator/GrapheneApiGenerator.java @@ -573,7 +573,7 @@ public abstract class GrapheneApiGenerator { public void onError(BaseResponse.Error error) { 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(); } @@ -589,7 +589,7 @@ public abstract class GrapheneApiGenerator { for(BitsharesAsset quoteAsset : quoteAssets){ WebSocketThread thread = new WebSocketThread(new GetLimitOrders(baseAsset.getBitsharesId(), 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(); } } diff --git a/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java b/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java index 6431e7c..1c81c62 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java +++ b/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java @@ -43,11 +43,6 @@ public class CrystalApplication extends Application { "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 public static BitsharesAsset bitUSDAsset = new BitsharesAsset("USD",4,"1.3.121",BitsharesAsset.Type.SMART_COIN); //This is for testing the equivalent values on the testnet TODO remove diff --git a/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java b/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java index c382cc5..5f70961 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java +++ b/app/src/main/java/cy/agorise/crystalwallet/network/BitsharesCryptoNetVerifier.java @@ -11,17 +11,8 @@ import cy.agorise.graphenej.models.WitnessResponse; */ public class BitsharesCryptoNetVerifier extends CryptoNetVerifier { - - - /** - * TODO We need to change this to a type of subCryptoNet - */ private final CryptoNet cryptoNet = CryptoNet.BITSHARES; - /** - * Todo info need to be on the SubCryptoNet - */ - private final String CHAIN_ID = "9cf6f255a208100d2bb275a3c52f4b1589b7ec9c9bfc2cb2a5fe6411295106d8";//testnet - //private final String CHAIN_ID = "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8";//mainnet + private final String CHAIN_ID = "4018d7844c78f6a6c41c6a552b898022310fc5dec06da467ee7905a8dad512c8";//mainnet @Override public void checkURL(final String url) { From 90929d9ee5f429c2bd2c2d86cf84ec1e9de498ea Mon Sep 17 00:00:00 2001 From: Henry Varona Date: Tue, 18 Sep 2018 20:26:35 -0400 Subject: [PATCH 6/6] arrange node list --- .../agorise/crystalwallet/application/CrystalApplication.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java b/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java index 1c81c62..7b60c40 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java +++ b/app/src/main/java/cy/agorise/crystalwallet/application/CrystalApplication.java @@ -37,10 +37,8 @@ public class CrystalApplication extends Application { { "wss://de.palmpay.io/ws", // Custom node "wss://bitshares.nu/ws", - "wss://dexnode.net/ws", // Dallas, USA "wss://bitshares.crypto.fans/ws", // Munich, Germany "wss://bitshares.openledger.info/ws", // Openledger node - "ws://185.208.208.147:8090" // Custom node }; //This is for testing the equivalent values on the testnet TODO remove