Add forgot password screen

This commit is contained in:
Nezumi
2023-02-08 22:28:33 +07:00
parent 6b5959d403
commit 133b54f2b7
6 changed files with 145 additions and 5 deletions
+5 -4
View File
@@ -13,16 +13,17 @@
android:supportsRtl="true"
android:theme="@style/Theme.Foodify"
tools:targetApi="31">
<activity
android:name=".ForgotPasswordActivity"
android:exported="false" />
<activity
android:name=".SignInActivity"
android:exported="false"
android:noHistory="true"
/>
android:noHistory="true" />
<activity
android:name=".SignUpActivity"
android:exported="false"
android:noHistory="true"
/>
android:noHistory="true" />
<activity
android:name=".SplashScreenActivity"
android:exported="true">
@@ -0,0 +1,31 @@
package com.capstone.foodify;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.Typeface;
import android.os.Bundle;
import com.google.android.material.textfield.TextInputLayout;
public class ForgotPasswordActivity extends AppCompatActivity {
TextInputLayout textInput_account;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forgot_password);
setFontUI();
}
private void setFontUI() {
Typeface bebas= Typeface.createFromAsset(getAssets(), "font/bebas.ttf");
textInput_account = (TextInputLayout) findViewById(R.id.textInput_account);
textInput_account.setTypeface(bebas);
}
}
@@ -1,6 +1,7 @@
package com.capstone.foodify;
import android.content.Intent;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
@@ -11,19 +12,25 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.textfield.TextInputLayout;
import java.util.Objects;
public class SignInActivity extends AppCompatActivity {
TextView signUp_textView;
TextView signUp_textView, forgotPassword_textView;
TextInputLayout textInput_account, textInput_password;
ImageView back_image;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sign_in);
setFontUI();
signUp_textView = (TextView) findViewById(R.id.sign_up_textView);
forgotPassword_textView = (TextView) findViewById(R.id.forgotPassword_textView);
back_image = (ImageView) findViewById(R.id.back_image);
@@ -39,6 +46,23 @@ public class SignInActivity extends AppCompatActivity {
startActivity(new Intent(SignInActivity.this, SignUpActivity.class));
}
});
forgotPassword_textView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(SignInActivity.this, ForgotPasswordActivity.class));
}
});
}
private void setFontUI() {
Typeface bebas= Typeface.createFromAsset(getAssets(), "font/bebas.ttf");
textInput_account = (TextInputLayout) findViewById(R.id.textInput_account);
textInput_password = (TextInputLayout) findViewById(R.id.textInput_password);
textInput_account.setTypeface(bebas);
textInput_password.setTypeface(bebas);
}
// this event will enable the back
Binary file not shown.
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ForgotPasswordActivity">
<ImageView
android:id="@+id/back_image"
android:layout_width="20dp"
android:layout_height="20dp"
android:src="@drawable/back_button"
android:layout_marginStart="10dp"
android:layout_marginTop="25dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="35dp"
android:fontFamily="@font/bebas"
android:text="@string/forgot_password"
android:textColor="@color/black"
android:textSize="50sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/back_image" />
<TextView
android:id="@+id/forgot_Password_description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/forgot_password_description"
android:fontFamily="@font/poppins"
android:textColor="@color/gray"
android:textStyle="bold"
android:layout_marginStart="20dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInput_account"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="40dp"
android:hint="@string/phone_or_email"
app:boxBackgroundColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:startIconDrawable="@drawable/baseline_person_24"
app:startIconTint="@color/primaryColor">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edt_email"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/sign_up_button"
style="@style/DefaultSolid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="@font/bebas"
android:padding="10dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginTop="30dp"
android:text="Gửi mã xác nhận"
android:textSize="20sp"
app:layout_constraintTop_toBottomOf="@+id/textInput_account" />
</androidx.constraintlayout.widget.ConstraintLayout>
+1
View File
@@ -21,4 +21,5 @@
<string name="phone_or_email">số điện thoại hoặc email</string>
<string name="forgot_password">quên mật khẩu?</string>
<string name="dont_have_an_account">Bạn chưa có tài khoản?</string>
<string name="forgot_password_description">Chúng tôi sẽ gửi mã xác nhận qua email của bạn.</string>
</resources>