mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Refactor Code, fix UI
This commit is contained in:
Generated
-17
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="deploymentTargetDropDown">
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="SERIAL_NUMBER" />
|
||||
<value value="60646e70" />
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2023-04-10T09:08:51.884599900Z" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -93,10 +93,6 @@
|
||||
android:name=".Activity.FoodDetailActivity"
|
||||
android:exported="false"
|
||||
android:noHistory="true" />
|
||||
<activity
|
||||
android:name=".Activity.ResetPasswordActivity"
|
||||
android:exported="false"
|
||||
android:noHistory="true" />
|
||||
<activity
|
||||
android:name=".Activity.VerifyAccountActivity"
|
||||
android:exported="false" />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.capstone.foodify.API;
|
||||
|
||||
import com.capstone.foodify.Common;
|
||||
import com.capstone.foodify.Model.Comment;
|
||||
import com.capstone.foodify.Model.DistrictWardResponse;
|
||||
import com.capstone.foodify.Model.Food;
|
||||
@@ -31,7 +32,7 @@ public interface FoodApi {
|
||||
Gson gson = new GsonBuilder().setDateFormat("HH:mm:ss dd-MM-yyyy").setLenient().create();
|
||||
|
||||
FoodApi apiService = new Retrofit.Builder()
|
||||
.baseUrl("http://192.168.1.183:8080/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl(Common.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
.create(FoodApi.class);
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import static com.capstone.foodify.Common.TOKEN;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.capstone.foodify.Common;
|
||||
import com.capstone.foodify.Model.Address;
|
||||
import com.capstone.foodify.Model.Comment;
|
||||
import com.capstone.foodify.Model.Food;
|
||||
@@ -47,7 +48,7 @@ public interface FoodApiToken {
|
||||
|
||||
FoodApiToken apiService = new Retrofit.Builder()
|
||||
.client(client)
|
||||
.baseUrl("http://192.168.1.183:8080/api/").addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.baseUrl(Common.BASE_URL).addConverterFactory(GsonConverterFactory.create(gson))
|
||||
.build()
|
||||
.create(FoodApiToken.class);
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.capstone.foodify.API;
|
||||
|
||||
import com.capstone.foodify.Common;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Retrofit;
|
||||
import retrofit2.converter.scalars.ScalarsConverterFactory;
|
||||
import retrofit2.http.GET;
|
||||
|
||||
public interface TokenFCMFirebaseAPI {
|
||||
|
||||
TokenFCMFirebaseAPI apiService = new Retrofit.Builder()
|
||||
.baseUrl(Common.BASE_URL).addConverterFactory(ScalarsConverterFactory.create())
|
||||
.build()
|
||||
.create(TokenFCMFirebaseAPI.class);
|
||||
|
||||
@GET("users/{userId}/fcm")
|
||||
Call<String> getTokenFCM();
|
||||
}
|
||||
@@ -16,6 +16,8 @@ import com.capstone.foodify.Common;
|
||||
import com.capstone.foodify.Model.Response.CustomResponse;
|
||||
import com.capstone.foodify.Model.User;
|
||||
import com.capstone.foodify.R;
|
||||
import com.google.android.gms.tasks.OnCompleteListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.firebase.FirebaseException;
|
||||
@@ -23,16 +25,24 @@ import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.PhoneAuthCredential;
|
||||
import com.google.firebase.auth.PhoneAuthOptions;
|
||||
import com.google.firebase.auth.PhoneAuthProvider;
|
||||
import com.google.firebase.auth.SignInMethodQueryResult;
|
||||
import com.thecode.aestheticdialogs.AestheticDialog;
|
||||
import com.thecode.aestheticdialogs.DialogStyle;
|
||||
import com.thecode.aestheticdialogs.DialogType;
|
||||
import com.thecode.aestheticdialogs.OnDialogClickListener;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class ForgotPasswordActivity extends AppCompatActivity {
|
||||
TextInputLayout textInput_phone;
|
||||
EditText edt_phone;
|
||||
private FirebaseAuth mAuth;
|
||||
TextInputLayout textInput_email;
|
||||
EditText edt_email;
|
||||
MaterialButton send_code_button;
|
||||
ConstraintLayout progress_layout;
|
||||
ImageView back_image;
|
||||
@@ -43,6 +53,8 @@ public class ForgotPasswordActivity extends AppCompatActivity {
|
||||
|
||||
initComponent();
|
||||
|
||||
mAuth = FirebaseAuth.getInstance();
|
||||
|
||||
//Back button
|
||||
back_image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -54,86 +66,85 @@ public class ForgotPasswordActivity extends AppCompatActivity {
|
||||
send_code_button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
progress_layout.setVisibility(View.VISIBLE);
|
||||
if(checkEmailValid()){
|
||||
mAuth.setLanguageCode("vi");
|
||||
|
||||
findUserByPhone(edt_phone.getText().toString());
|
||||
mAuth.fetchSignInMethodsForEmail(edt_email.getText().toString())
|
||||
.addOnCompleteListener(new OnCompleteListener<SignInMethodQueryResult>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<SignInMethodQueryResult> task) {
|
||||
|
||||
boolean isNewUser = task.getResult().getSignInMethods().isEmpty();
|
||||
|
||||
if (isNewUser) {
|
||||
new AestheticDialog.Builder(ForgotPasswordActivity.this, DialogStyle.TOASTER, DialogType.ERROR)
|
||||
.setTitle("Thông báo!")
|
||||
.setMessage("Tài khoản chưa được đăng ký ở hệ thống! Vui lòng kiểm tra lại")
|
||||
.setCancelable(true).show();
|
||||
} else {
|
||||
sendEmail();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setFontUI();
|
||||
}
|
||||
|
||||
private void findUserByPhone(String phone){
|
||||
private void sendEmail(){
|
||||
|
||||
User user = new User();
|
||||
user.setPhoneNumber(phone);
|
||||
|
||||
FoodApi.apiService.checkEmailOrPhoneExist(user).enqueue(new Callback<CustomResponse>() {
|
||||
mAuth.sendPasswordResetEmail(edt_email.getText().toString()).addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
||||
CustomResponse responseData = response.body();
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
if(task.isSuccessful()){
|
||||
new AestheticDialog.Builder(ForgotPasswordActivity.this, DialogStyle.TOASTER, DialogType.SUCCESS)
|
||||
.setTitle("Email đã được gửi!")
|
||||
.setMessage("Vui lòng kiểm tra hộp thư và làm theo hướng dẫn để tiếp tục!")
|
||||
.setCancelable(true).show();
|
||||
|
||||
if(responseData != null){
|
||||
if(responseData.isTrue()){
|
||||
//If this phone number has already register in server, send the code
|
||||
|
||||
} else {
|
||||
//If this phone number
|
||||
Toast.makeText(ForgotPasswordActivity.this, "Hệ thống hiện chưa tìm thấy số điện thoại này, vui lòng kiểm tra lại!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
progress_layout.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<CustomResponse> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void sendCode(){
|
||||
FirebaseAuth auth = FirebaseAuth.getInstance();
|
||||
auth.setLanguageCode("vi");
|
||||
PhoneAuthOptions options = PhoneAuthOptions.newBuilder(auth)
|
||||
.setPhoneNumber(Common.PHONE_CODE + edt_phone.getText().toString())
|
||||
.setTimeout(0L, TimeUnit.SECONDS)
|
||||
.setActivity(this)
|
||||
.setCallbacks(new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
|
||||
@Override
|
||||
public void onCodeSent(@NonNull String verificationId,
|
||||
@NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
|
||||
private boolean checkEmailValid() {
|
||||
boolean dataHasValidate = true;
|
||||
|
||||
//Check phone number
|
||||
if (edt_email.getText().toString().isEmpty()) {
|
||||
textInput_email.setError("Email không được bỏ trống!");
|
||||
dataHasValidate = false;
|
||||
} else {
|
||||
|
||||
Intent intent = new Intent(ForgotPasswordActivity.this, VerifyAccountActivity.class);
|
||||
intent.putExtra("phone", edt_phone.getText().toString());
|
||||
intent.putExtra("verificationId", verificationId);
|
||||
intent.putExtra(Common.IS_FORGOT_PASSWORD, Common.IS_FORGOT_PASSWORD);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
//Check email valid
|
||||
Pattern patternEmail = Pattern.compile(Common.VALID_EMAIL_ADDRESS_REGEX, Pattern.CASE_INSENSITIVE);
|
||||
Matcher matcherEmail = patternEmail.matcher(edt_email.getText().toString());
|
||||
if (!matcherEmail.matches()) {
|
||||
textInput_email.setError("Địa chỉ email không đúng định dạng. Xin vui lòng kiểm tra lại!");
|
||||
dataHasValidate = false;
|
||||
} else {
|
||||
textInput_email.setErrorEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationFailed(@NonNull FirebaseException e) {
|
||||
// ...
|
||||
}
|
||||
})
|
||||
.build();
|
||||
PhoneAuthProvider.verifyPhoneNumber(options);
|
||||
return dataHasValidate;
|
||||
}
|
||||
|
||||
private void setFontUI() {
|
||||
textInput_phone = (TextInputLayout) findViewById(R.id.textInput_phone);
|
||||
textInput_phone.setTypeface(Common.setFontBebas(getAssets()));
|
||||
|
||||
textInput_email.setTypeface(Common.setFontBebas(getAssets()));
|
||||
}
|
||||
|
||||
private void initComponent() {
|
||||
back_image = (ImageView) findViewById(R.id.back_image);
|
||||
send_code_button = (MaterialButton) findViewById(R.id.send_code_button);
|
||||
edt_phone = findViewById(R.id.edt_phone);
|
||||
textInput_email = findViewById(R.id.textInput_email);
|
||||
back_image = findViewById(R.id.back_image);
|
||||
send_code_button = findViewById(R.id.send_code_button);
|
||||
edt_email = findViewById(R.id.edt_email);
|
||||
progress_layout = findViewById(R.id.progress_layout);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,9 +168,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
startPowerSaverIntent(this);
|
||||
checkNotificationPermission();
|
||||
|
||||
if(Common.CURRENT_USER != null)
|
||||
getTokenFCM();
|
||||
|
||||
|
||||
if (Common.CURRENT_LOCATION == null) {
|
||||
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
@@ -227,6 +224,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
|
||||
String token = task.getResult();
|
||||
|
||||
Common.FCM_TOKEN = token;
|
||||
FoodApiToken.apiService.updateFCMToken(Common.CURRENT_USER.getId(), token).enqueue(new Callback<CustomResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
||||
@@ -307,8 +305,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//myringtone permission
|
||||
private void checkNotificationPermission(){
|
||||
if(!NotificationManagerCompat.from(this).areNotificationsEnabled()){
|
||||
showDialogPermission("Hãy bật quyền thông báo trên thiết bị của bạn để chúng thôi có thể cung cấp thông tin cho bạn một cách nhanh nhất!");
|
||||
@@ -428,6 +424,9 @@ public class MainActivity extends AppCompatActivity {
|
||||
if (mRequestingLocationUpdates && checkPermission() && Common.CURRENT_LOCATION == null) {
|
||||
startLocationUpdates();
|
||||
}
|
||||
|
||||
if(Common.CURRENT_USER != null && Common.FCM_TOKEN == null)
|
||||
getTokenFCM();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -441,9 +440,6 @@ public class MainActivity extends AppCompatActivity {
|
||||
Common.CURRENT_LOCATION = mCurrentLocation;
|
||||
}
|
||||
}
|
||||
|
||||
if(Common.CURRENT_USER != null)
|
||||
getTokenFCM();
|
||||
}
|
||||
|
||||
//Check auto start permission
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
package com.capstone.foodify.Activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.capstone.foodify.Common;
|
||||
import com.capstone.foodify.R;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
public class ResetPasswordActivity extends AppCompatActivity {
|
||||
|
||||
ImageView close_image;
|
||||
TextInputLayout textInput_password, textInput_confirmPassword;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_reset_password);
|
||||
|
||||
initComponent();
|
||||
|
||||
setFontUI();
|
||||
|
||||
close_image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setFontUI() {
|
||||
textInput_password.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_confirmPassword.setTypeface(Common.setFontBebas(getAssets()));
|
||||
}
|
||||
|
||||
private void initComponent() {
|
||||
close_image = (ImageView) findViewById(R.id.close_image);
|
||||
textInput_password = (TextInputLayout) findViewById(R.id.textInput_password);
|
||||
textInput_confirmPassword = (TextInputLayout) findViewById(R.id.textInput_confirmPassword);
|
||||
}
|
||||
}
|
||||
@@ -40,9 +40,10 @@ import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class Common {
|
||||
public static final String BASE_URL = "https://foodify-backend-production.up.railway.app/api/";
|
||||
public static String FCM_TOKEN = null;
|
||||
public static Location CURRENT_LOCATION = null;
|
||||
public static final String MAP_API = "AIzaSyAY14Ic32UP26Hg6GILznOfbBihiY5BUxw";
|
||||
public static final String IS_FORGOT_PASSWORD = "isForgotPassword";
|
||||
public static final String FORMAT_DATE="dd-MM-yyyy";
|
||||
public static final String VALID_EMAIL_ADDRESS_REGEX = "^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,6}$";
|
||||
public static final String PHONE_CODE = "+84";
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 518 KiB |
@@ -38,40 +38,43 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forgot_Password_description"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/forgot_password_description"
|
||||
android:text="Vui lòng nhập địa chỉ email vào ô dưới đây để tiến hành đặt lại mật khẩu của bạn."
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/gray"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="25dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_phone"
|
||||
android:id="@+id/textInput_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:hint="@string/phone"
|
||||
android:hint="@string/email_text"
|
||||
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:startIconDrawable="@drawable/baseline_email_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_phone"
|
||||
android:id="@+id/edt_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="phone" />
|
||||
android:inputType="textEmailAddress" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
@@ -82,12 +85,12 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:padding="10dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="Gửi mã xác nhận"
|
||||
android:text="Gửi email"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_phone" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_email" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
@@ -304,7 +304,8 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/confirm_address_button"
|
||||
android:text="Xác nhận"
|
||||
android:text="XÁC NHẬN"
|
||||
android:textSize="14sp"
|
||||
android:textAllCaps="false"
|
||||
android:backgroundTint="@color/primaryColor"
|
||||
android:layout_width="120dp"
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
<?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=".Activity.ResetPasswordActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_image"
|
||||
android:layout_width="20dp"
|
||||
android:layout_height="20dp"
|
||||
android:src="@drawable/close_icon"
|
||||
android:layout_marginStart="20dp"
|
||||
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="90dp"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:text="Đặt lại mật khẩu"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="50sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/close_image" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:hint="@string/new_password"
|
||||
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_vpn_key_24"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="@color/primaryColor"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textPassword" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_confirmPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:hint="@string/repeat_password_text"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="@color/primaryColor"
|
||||
app:startIconDrawable="@drawable/baseline_vpn_key_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_confirmPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textPassword" />
|
||||
|
||||
</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:layout_marginEnd="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:padding="10dp"
|
||||
android:text="Gửi mã xác nhận"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -36,95 +36,119 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/back_image" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/logo_image"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginTop="32dp"
|
||||
android:src="@drawable/logo"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_email"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:hint="@string/email_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/logo_image"
|
||||
app:startIconDrawable="@drawable/baseline_person_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_email"
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/logo_image"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:src="@drawable/logo"
|
||||
app:riv_corner_radius="20dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_name_app"
|
||||
android:text="Foodify"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:textSize="30sp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/logo_image"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textEmailAddress" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="60dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:hint="@string/email_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txt_name_app"
|
||||
app:startIconDrawable="@drawable/baseline_person_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textEmailAddress" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:hint="@string/password_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_email"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="@color/primaryColor"
|
||||
app:startIconDrawable="@drawable/baseline_vpn_key_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_password"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textPassword" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:hint="@string/password_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_email"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="@color/primaryColor"
|
||||
app:startIconDrawable="@drawable/baseline_vpn_key_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textPassword" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/forgotPassword_textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:text="@string/forgot_password"
|
||||
android:textColor="@color/grayLight"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/sign_in_button"
|
||||
style="@style/DefaultSolid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:padding="10dp"
|
||||
android:text="@string/sign_in_text"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password" />
|
||||
<TextView
|
||||
android:id="@+id/forgotPassword_textView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:text="@string/forgot_password"
|
||||
android:textColor="@color/grayLight"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password"
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/sign_in_button"
|
||||
style="@style/DefaultSolid"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:fontFamily="@font/bebas"
|
||||
android:padding="10dp"
|
||||
android:text="@string/sign_in_text"
|
||||
android:textSize="20sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_password" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linearLayout"
|
||||
|
||||
Reference in New Issue
Block a user