From b6a9e6b59c11d253ba41a1be23db1403679b719d Mon Sep 17 00:00:00 2001 From: dtvv Date: Tue, 18 Sep 2018 12:45:01 -0500 Subject: [PATCH] =?UTF-8?q?Add=20new=20Tab=20called=20=E2=80=9CMerchants?= =?UTF-8?q?=E2=80=9D=20and=20inside=20it=20should=20be=20=E2=80=9CComming?= =?UTF-8?q?=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 @@ + + + + +