Created layout for the IntroActivity

This commit is contained in:
Severiano Jaramillo 2018-01-24 17:21:34 -06:00
parent fa8d39ca6d
commit aabdab2951
5 changed files with 119 additions and 6 deletions

View file

@ -12,7 +12,8 @@
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme">
<activity android:name=".activities.IntroActivity"> <activity android:name=".activities.IntroActivity"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />

View file

@ -15,6 +15,9 @@ import android.widget.Button;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import cy.agorise.crystalwallet.R; import cy.agorise.crystalwallet.R;
import cy.agorise.crystalwallet.dao.CrystalDatabase; import cy.agorise.crystalwallet.dao.CrystalDatabase;
import cy.agorise.crystalwallet.models.AccountSeed; import cy.agorise.crystalwallet.models.AccountSeed;
@ -36,26 +39,33 @@ public class IntroActivity extends AppCompatActivity {
TransactionListViewModel transactionListViewModel; TransactionListViewModel transactionListViewModel;
TransactionListView transactionListView; TransactionListView transactionListView;
@BindView(R.id.btnCreateAccount)
public Button btnCreateAccount;
@BindView(R.id.btnImportAccount)
public Button btnImportAccount;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_intro); setContentView(R.layout.activity_intro);
ButterKnife.bind(this);
//Checks if the user has any seed created //Checks if the user has any seed created
AccountSeedListViewModel accountSeedListViewModel = ViewModelProviders.of(this).get(AccountSeedListViewModel.class); 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 //If the user doesn't have any seeds created, then
//send the user to create/import an account //send the user to create/import an account
//Intent intent = new Intent(this, AccountSeedsManagementActivity.class); //Intent intent = new Intent(this, AccountSeedsManagementActivity.class);
//Intent intent = new Intent(this, ImportSeedActivity.class); //Intent intent = new Intent(this, ImportSeedActivity.class);
Intent intent = new Intent(this, CreateSeedActivity.class); //Intent intent = new Intent(this, CreateSeedActivity.class);
startActivity(intent); //startActivity(intent);
} else { } else {
//Intent intent = new Intent(this, CreateSeedActivity.class); //Intent intent = new Intent(this, CreateSeedActivity.class);
Intent intent = new Intent(this, BoardActivity.class); Intent intent = new Intent(this, BoardActivity.class);
startActivity(intent); startActivity(intent);
} }*/
/*CrystalDatabase db = CrystalDatabase.getAppDatabase(getApplicationContext()); /*CrystalDatabase db = CrystalDatabase.getAppDatabase(getApplicationContext());
List<AccountSeed> seeds = RandomSeedGenerator.generateSeeds(2); List<AccountSeed> 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() {
}
} }

View file

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_intro" android:id="@+id/activity_intro"
@ -17,3 +18,91 @@
</cy.agorise.crystalwallet.views.TransactionListView> </cy.agorise.crystalwallet.views.TransactionListView>
</RelativeLayout> </RelativeLayout>
-->
<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:id="@+id/activity_intro"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
tools:context="cy.agorise.crystalwallet.activities.IntroActivity">
<ImageView
android:id="@+id/ivLogo"
android:layout_width="wrap_content"
android:layout_height="60dp"
android:src="@drawable/crystal_logo"
app:layout_constraintBottom_toTopOf="@+id/tvNewUser"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintVertical_bias="0.4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<TextView
android:id="@+id/tvNewUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="80dp"
android:text="@string/new_user"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/btnCreateAccount"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/ivLogo" />
<Button
android:id="@+id/btnCreateAccount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:background="@color/colorPrimaryDark"
android:text="Create Account"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/tvExistingUser"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvNewUser" />
<TextView
android:id="@+id/tvExistingUser"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="32dp"
android:text="@string/existing_user"
android:textColor="@color/white"
android:textSize="16sp"
app:layout_constraintBottom_toTopOf="@+id/btnImportAccount"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnCreateAccount" />
<Button
android:id="@+id/btnImportAccount"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="32dp"
android:layout_marginStart="32dp"
android:layout_marginTop="8dp"
android:background="@color/colorPrimaryDark"
android:text="Import Account"
android:textAllCaps="false"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvExistingUser" />
</android.support.constraint.ConstraintLayout>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<color name="colorPrimary">#0099d6</color> <color name="colorPrimary">#0099d6</color>
<color name="colorPrimaryDark">#0099d6</color> <color name="colorPrimaryDark">#006fd6</color>
<color name="colorAccent">#0099d6</color> <color name="colorAccent">#0099d6</color>
<color name="gray">#d3d3d3</color> <color name="gray">#d3d3d3</color>
<color name="darkGray">#686767</color> <color name="darkGray">#686767</color>

View file

@ -496,4 +496,6 @@
<string name="none">None</string> <string name="none">None</string>
<string name="pin">Pin</string> <string name="pin">Pin</string>
<string name="pattern">Pattern</string> <string name="pattern">Pattern</string>
<string name="new_user">New user?</string>
<string name="existing_user">Existing user?</string>
</resources> </resources>