Create register activity
This commit is contained in:
parent
9fd62f9565
commit
9fae8ce5b5
@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:exported="true"
|
android:exported="false"
|
||||||
android:label="@string/title_activity_main" />
|
android:label="@string/title_activity_main" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
@ -34,6 +34,10 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".LoginActivity"
|
android:name=".LoginActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".RegisterActivity"
|
||||||
|
android:exported="false" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
@ -0,0 +1,28 @@
|
|||||||
|
package tech.mercantec.easyeat
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.widget.Button
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.core.view.ViewCompat
|
||||||
|
import androidx.core.view.WindowInsetsCompat
|
||||||
|
|
||||||
|
class RegisterActivity : AppCompatActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
setContentView(R.layout.activity_register)
|
||||||
|
|
||||||
|
findViewById<Button>(R.id.register).setOnClickListener {
|
||||||
|
// TODO create account
|
||||||
|
|
||||||
|
startActivity(Intent(this, LoginActivity::class.java))
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
|
findViewById<Button>(R.id.back).setOnClickListener {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -21,7 +21,7 @@ class WelcomeActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
findViewById<Button>(R.id.register).setOnClickListener {
|
findViewById<Button>(R.id.register).setOnClickListener {
|
||||||
startActivity(Intent(this, LoginActivity::class.java))
|
startActivity(Intent(this, RegisterActivity::class.java))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
96
app/app/src/main/res/layout/activity_register.xml
Normal file
96
app/app/src/main/res/layout/activity_register.xml
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingStart="30sp"
|
||||||
|
android:paddingEnd="30sp"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="@string/register_heading"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="50sp"
|
||||||
|
android:layout_marginLeft="2sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/username_label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/username_hint"
|
||||||
|
android:autofillHints="emailAddress"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="20sp"
|
||||||
|
android:layout_marginLeft="2sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/email_label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/email_hint"
|
||||||
|
android:autofillHints="emailAddress"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="20sp"
|
||||||
|
android:layout_marginLeft="2sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/password_label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/password_hint"
|
||||||
|
android:autofillHints="password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_marginTop="20sp"
|
||||||
|
android:layout_marginLeft="2sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/confirm_password_label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/password_hint"
|
||||||
|
android:autofillHints="password"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/register"
|
||||||
|
android:layout_marginTop="20sp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/register_label"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/back"
|
||||||
|
android:layout_marginTop="20sp"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/back_label"
|
||||||
|
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
@ -1,10 +1,10 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<style name="Theme.EasyEat" parent="Theme.MaterialComponents.DayNight">
|
||||||
<style name="Theme.EasyEat" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
|
||||||
<item name="colorPrimary">@color/cyan</item>
|
<item name="colorPrimary">@color/cyan</item>
|
||||||
<item name="colorPrimaryVariant">@color/dark_cyan</item>
|
<item name="colorPrimaryVariant">@color/dark_cyan</item>
|
||||||
<item name="colorOnPrimary">@color/white</item>
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
<item name="colorSecondary">@color/dark_gray</item>
|
<item name="colorSecondary">@color/dark_gray</item>
|
||||||
|
<item name="colorSurface">@color/dark_cyan</item>
|
||||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||||
<item name="android:colorBackground">@color/black</item>
|
<item name="android:colorBackground">@color/black</item>
|
||||||
</style>
|
</style>
|
||||||
|
@ -8,9 +8,13 @@
|
|||||||
<string name="login_label">Login</string>
|
<string name="login_label">Login</string>
|
||||||
<string name="login_heading">Login to EasyEat</string>
|
<string name="login_heading">Login to EasyEat</string>
|
||||||
<string name="register_label">Register</string>
|
<string name="register_label">Register</string>
|
||||||
|
<string name="register_heading">Register an account</string>
|
||||||
|
<string name="username_label">Username</string>
|
||||||
|
<string name="username_hint">John Doe</string>
|
||||||
<string name="email_label">Email</string>
|
<string name="email_label">Email</string>
|
||||||
<string name="email_hint">john@doe.com</string>
|
<string name="email_hint">john@doe.com</string>
|
||||||
<string name="password_label">Password</string>
|
<string name="password_label">Password</string>
|
||||||
|
<string name="confirm_password_label">Confirm password</string>
|
||||||
<string name="password_hint">••••••••</string>
|
<string name="password_hint">••••••••</string>
|
||||||
<string name="back_label">Back</string>
|
<string name="back_label">Back</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<style name="Theme.EasyEat" parent="Theme.MaterialComponents.DayNight">
|
||||||
<style name="Theme.EasyEat" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
|
||||||
<item name="colorPrimary">@color/cyan</item>
|
<item name="colorPrimary">@color/cyan</item>
|
||||||
<item name="colorPrimaryVariant">@color/dark_cyan</item>
|
<item name="colorPrimaryVariant">@color/dark_cyan</item>
|
||||||
<item name="colorOnPrimary">@color/white</item>
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user