From aabdab29518c1383f4e99ecec51a922a036444ed Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Wed, 24 Jan 2018 17:21:34 -0600 Subject: [PATCH] Created layout for the IntroActivity --- app/src/main/AndroidManifest.xml | 3 +- .../activities/IntroActivity.java | 29 +++++- app/src/main/res/layout/activity_intro.xml | 89 +++++++++++++++++++ app/src/main/res/values/colors.xml | 2 +- app/src/main/res/values/strings.xml | 2 + 5 files changed, 119 insertions(+), 6 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 52adab6..c323856 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,7 +12,8 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - + diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java index f638df3..92414b0 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/IntroActivity.java @@ -15,6 +15,9 @@ import android.widget.Button; import java.util.List; +import butterknife.BindView; +import butterknife.ButterKnife; +import butterknife.OnClick; import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.dao.CrystalDatabase; import cy.agorise.crystalwallet.models.AccountSeed; @@ -36,26 +39,33 @@ public class IntroActivity extends AppCompatActivity { TransactionListViewModel transactionListViewModel; TransactionListView transactionListView; + @BindView(R.id.btnCreateAccount) + public Button btnCreateAccount; + + @BindView(R.id.btnImportAccount) + public Button btnImportAccount; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_intro); + ButterKnife.bind(this); //Checks if the user has any seed created AccountSeedListViewModel accountSeedListViewModel = ViewModelProviders.of(this).get(AccountSeedListViewModel.class); - if (accountSeedListViewModel.accountSeedsCount() == 0){ + /*if (accountSeedListViewModel.accountSeedsCount() == 0){ //If the user doesn't have any seeds created, then //send the user to create/import an account //Intent intent = new Intent(this, AccountSeedsManagementActivity.class); //Intent intent = new Intent(this, ImportSeedActivity.class); - Intent intent = new Intent(this, CreateSeedActivity.class); - startActivity(intent); + //Intent intent = new Intent(this, CreateSeedActivity.class); + //startActivity(intent); } else { //Intent intent = new Intent(this, CreateSeedActivity.class); Intent intent = new Intent(this, BoardActivity.class); startActivity(intent); - } + }*/ /*CrystalDatabase db = CrystalDatabase.getAppDatabase(getApplicationContext()); List seeds = RandomSeedGenerator.generateSeeds(2); @@ -92,4 +102,15 @@ public class IntroActivity extends AppCompatActivity { } });*/ } + + @OnClick(R.id.btnCreateAccount) + public void createAccount() { + Intent intent = new Intent(this, CreateSeedActivity.class); + startActivity(intent); + } + + @OnClick(R.id.btnImportAccount) + public void importAccount() { + + } } diff --git a/app/src/main/res/layout/activity_intro.xml b/app/src/main/res/layout/activity_intro.xml index 82d17bd..b8a8c47 100644 --- a/app/src/main/res/layout/activity_intro.xml +++ b/app/src/main/res/layout/activity_intro.xml @@ -1,4 +1,5 @@ + + + + + + + +