Created layout for the IntroActivity
This commit is contained in:
parent
fa8d39ca6d
commit
aabdab2951
5 changed files with 119 additions and 6 deletions
|
@ -12,7 +12,8 @@
|
|||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".activities.IntroActivity">
|
||||
<activity android:name=".activities.IntroActivity"
|
||||
android:theme="@style/AppTheme.NoActionBar">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
|
|
|
@ -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<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() {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/activity_intro"
|
||||
|
@ -17,3 +18,91 @@
|
|||
|
||||
</cy.agorise.crystalwallet.views.TransactionListView>
|
||||
</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>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#0099d6</color>
|
||||
<color name="colorPrimaryDark">#0099d6</color>
|
||||
<color name="colorPrimaryDark">#006fd6</color>
|
||||
<color name="colorAccent">#0099d6</color>
|
||||
<color name="gray">#d3d3d3</color>
|
||||
<color name="darkGray">#686767</color>
|
||||
|
|
|
@ -496,4 +496,6 @@
|
|||
<string name="none">None</string>
|
||||
<string name="pin">Pin</string>
|
||||
<string name="pattern">Pattern</string>
|
||||
<string name="new_user">New user?</string>
|
||||
<string name="existing_user">Existing user?</string>
|
||||
</resources>
|
||||
|
|
Loading…
Reference in a new issue