mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Add identified code in sign up user, improve layout
This commit is contained in:
@@ -32,17 +32,24 @@ import com.google.android.gms.tasks.OnFailureListener;
|
||||
import com.google.android.gms.tasks.OnSuccessListener;
|
||||
import com.google.android.gms.tasks.Task;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.firebase.auth.FirebaseAuth;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.google.firebase.storage.FirebaseStorage;
|
||||
import com.google.firebase.storage.OnProgressListener;
|
||||
import com.google.firebase.storage.StorageReference;
|
||||
import com.google.firebase.storage.UploadTask;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import com.thecode.aestheticdialogs.AestheticDialog;
|
||||
import com.thecode.aestheticdialogs.DialogStyle;
|
||||
import com.thecode.aestheticdialogs.DialogType;
|
||||
import com.thecode.aestheticdialogs.OnDialogClickListener;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Locale;
|
||||
|
||||
import io.paperdb.Paper;
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
@@ -60,6 +67,8 @@ public class AccountAndProfileActivity extends AppCompatActivity {
|
||||
private Uri imageUri;
|
||||
final private StorageReference storageReference = FirebaseStorage.getInstance().getReference();
|
||||
ConstraintLayout progressLayout;
|
||||
FirebaseAuth mAuth;
|
||||
FirebaseUser firebaseUser;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -72,6 +81,15 @@ public class AccountAndProfileActivity extends AppCompatActivity {
|
||||
//Init data
|
||||
initData();
|
||||
|
||||
//Initialize Firebase Auth
|
||||
mAuth = FirebaseAuth.getInstance();
|
||||
|
||||
//Paper Init
|
||||
Paper.init(this);
|
||||
|
||||
//Show notification about email verify for user
|
||||
showNotificationEmailVerify();
|
||||
|
||||
chooseDateOfBirth();
|
||||
|
||||
change_password.setOnClickListener(new View.OnClickListener() {
|
||||
@@ -199,66 +217,42 @@ public class AccountAndProfileActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private void initComponent() {
|
||||
//Init Component
|
||||
textInput_email= findViewById(R.id.textInput_email);
|
||||
textInput_phone = findViewById(R.id.textInput_phone);
|
||||
textInput_fullName = findViewById(R.id.textInput_fullName);
|
||||
textInput_birthDay = findViewById(R.id.textInput_birthDay);
|
||||
change_password = findViewById(R.id.change_password);
|
||||
private void showNotificationEmailVerify(){
|
||||
//Get firebase user from Paper
|
||||
firebaseUser = Paper.book().read("user");
|
||||
|
||||
update_button = findViewById(R.id.updated_button);
|
||||
update_image_button = findViewById(R.id.change_image_button);
|
||||
// Check if user is signed in (non-null) and update UI accordingly.
|
||||
firebaseUser = mAuth.getCurrentUser();
|
||||
if(firebaseUser != null){
|
||||
|
||||
back_image = findViewById(R.id.back_image);
|
||||
|
||||
edt_birthday = findViewById(R.id.edt_birthDay);
|
||||
edt_email = findViewById(R.id.edt_email);
|
||||
edt_phone = findViewById(R.id.edt_phone);
|
||||
edt_fullName = findViewById(R.id.edt_fullName);
|
||||
|
||||
profile_avatar = findViewById(R.id.profile_avatar);
|
||||
|
||||
progressLayout = findViewById(R.id.progress_layout);
|
||||
}
|
||||
|
||||
private void setFontUI() {
|
||||
textInput_email.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_phone.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_fullName.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_birthDay.setTypeface(Common.setFontBebas(getAssets()));
|
||||
|
||||
edt_birthday.setTypeface(Common.setFontBebas(getAssets()));
|
||||
}
|
||||
|
||||
private void chooseDateOfBirth() {
|
||||
//Get date, month, year from user
|
||||
String [] dateParts = edt_birthday.getText().toString().split("-");
|
||||
String day = dateParts[0];
|
||||
String month = dateParts[1];
|
||||
String year = dateParts[2];
|
||||
|
||||
//Calendar date of birth
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener(){
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year, int month, int day) {
|
||||
myCalendar.set(Calendar.YEAR, year);
|
||||
myCalendar.set(Calendar.MONTH,month);
|
||||
myCalendar.set(Calendar.DAY_OF_MONTH,day);
|
||||
updateLabel();
|
||||
if(!firebaseUser.isEmailVerified()){
|
||||
showDialogCaution();
|
||||
textInput_email.setError("Nhấp vào đây để xác thực!");
|
||||
textInput_email.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
//When user click on the text
|
||||
firebaseUser.sendEmailVerification().addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<Void> task) {
|
||||
Toast.makeText(AccountAndProfileActivity.this, "Email đã được gửi đi, vui lòng kiểm tra hộp thư của bạn!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
textInput_email.setErrorEnabled(false);
|
||||
}
|
||||
}, Integer.parseInt(year), Integer.parseInt(month) - 1, Integer.parseInt(day));
|
||||
edt_birthday.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
datePickerDialog.show();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void updateLabel(){
|
||||
SimpleDateFormat dateFormat=new SimpleDateFormat(Common.FORMAT_DATE, Locale.US);
|
||||
edt_birthday.setText(dateFormat.format(myCalendar.getTime()));
|
||||
private void showDialogCaution() {
|
||||
new AestheticDialog.Builder(this, DialogStyle.RAINBOW, DialogType.WARNING)
|
||||
.setTitle("Email chưa được xác thực!")
|
||||
.setMessage("Vui lòng xác thực email để bạn có thể thực hiện việc lấy lại mật khẩu nếu quên!")
|
||||
.setCancelable(true)
|
||||
.show();
|
||||
}
|
||||
|
||||
private void updateUser(String imageUrl) {
|
||||
@@ -286,4 +280,62 @@ public class AccountAndProfileActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
private void initComponent() {
|
||||
//Init Component
|
||||
textInput_email= findViewById(R.id.textInput_email);
|
||||
textInput_phone = findViewById(R.id.textInput_phone);
|
||||
textInput_fullName = findViewById(R.id.textInput_fullName);
|
||||
textInput_birthDay = findViewById(R.id.textInput_birthDay);
|
||||
change_password = findViewById(R.id.change_password);
|
||||
|
||||
update_button = findViewById(R.id.updated_button);
|
||||
update_image_button = findViewById(R.id.change_image_button);
|
||||
|
||||
back_image = findViewById(R.id.back_image);
|
||||
|
||||
edt_birthday = findViewById(R.id.edt_birthDay);
|
||||
edt_email = findViewById(R.id.edt_email);
|
||||
edt_phone = findViewById(R.id.edt_phone);
|
||||
edt_fullName = findViewById(R.id.edt_fullName);
|
||||
|
||||
profile_avatar = findViewById(R.id.profile_avatar);
|
||||
|
||||
progressLayout = findViewById(R.id.progress_layout);
|
||||
}
|
||||
private void setFontUI() {
|
||||
textInput_email.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_phone.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_fullName.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_birthDay.setTypeface(Common.setFontBebas(getAssets()));
|
||||
|
||||
edt_birthday.setTypeface(Common.setFontBebas(getAssets()));
|
||||
}
|
||||
private void chooseDateOfBirth() {
|
||||
//Get date, month, year from user
|
||||
String [] dateParts = edt_birthday.getText().toString().split("-");
|
||||
String day = dateParts[0];
|
||||
String month = dateParts[1];
|
||||
String year = dateParts[2];
|
||||
|
||||
//Calendar date of birth
|
||||
DatePickerDialog datePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener(){
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int year, int month, int day) {
|
||||
myCalendar.set(Calendar.YEAR, year);
|
||||
myCalendar.set(Calendar.MONTH,month);
|
||||
myCalendar.set(Calendar.DAY_OF_MONTH,day);
|
||||
updateLabel();
|
||||
}
|
||||
}, Integer.parseInt(year), Integer.parseInt(month) - 1, Integer.parseInt(day));
|
||||
edt_birthday.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
datePickerDialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
private void updateLabel(){
|
||||
SimpleDateFormat dateFormat=new SimpleDateFormat(Common.FORMAT_DATE, Locale.US);
|
||||
edt_birthday.setText(dateFormat.format(myCalendar.getTime()));
|
||||
}
|
||||
}
|
||||
@@ -1,22 +1,40 @@
|
||||
package com.capstone.foodify.Activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.capstone.foodify.API.FoodApi;
|
||||
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.material.button.MaterialButton;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
import com.google.firebase.FirebaseException;
|
||||
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 java.util.concurrent.TimeUnit;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class ForgotPasswordActivity extends AppCompatActivity {
|
||||
|
||||
TextInputLayout textInput_account;
|
||||
TextInputLayout textInput_phone;
|
||||
EditText edt_phone;
|
||||
MaterialButton send_code_button;
|
||||
|
||||
ConstraintLayout progress_layout;
|
||||
ImageView back_image;
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -36,21 +54,87 @@ public class ForgotPasswordActivity extends AppCompatActivity {
|
||||
send_code_button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(ForgotPasswordActivity.this, VerifyAccountActivity.class));
|
||||
|
||||
findUserByPhone(edt_phone.getText().toString());
|
||||
}
|
||||
});
|
||||
|
||||
setFontUI();
|
||||
}
|
||||
|
||||
private void findUserByPhone(String phone){
|
||||
|
||||
User user = new User();
|
||||
user.setPhoneNumber(phone);
|
||||
|
||||
FoodApi.apiService.checkEmailOrPhoneExist(user).enqueue(new Callback<CustomResponse>() {
|
||||
@Override
|
||||
public void onResponse(Call<CustomResponse> call, Response<CustomResponse> response) {
|
||||
CustomResponse responseData = response.body();
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@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) {
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationFailed(@NonNull FirebaseException e) {
|
||||
// ...
|
||||
}
|
||||
})
|
||||
.build();
|
||||
PhoneAuthProvider.verifyPhoneNumber(options);
|
||||
}
|
||||
|
||||
private void setFontUI() {
|
||||
textInput_account = (TextInputLayout) findViewById(R.id.textInput_account);
|
||||
textInput_account.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_phone = (TextInputLayout) findViewById(R.id.textInput_phone);
|
||||
textInput_phone.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);
|
||||
progress_layout = findViewById(R.id.progress_layout);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -52,16 +52,16 @@ import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class SignUpActivity extends AppCompatActivity {
|
||||
TextInputLayout textInput_password, textInput_phone, textInput_email,
|
||||
TextInputLayout textInput_password, textInput_phone, textInput_email, textInput_id_card,
|
||||
textInput_address, textInput_confirmPassword, textInput_fullName, textInput_birthDay;
|
||||
final Calendar myCalendar= Calendar.getInstance();
|
||||
private EditText edt_birthday, edt_phone, edt_passWord, edt_confirmPassword, edt_fullName, edt_address, edt_email;
|
||||
private EditText edt_birthday, edt_phone, edt_passWord, edt_confirmPassword, edt_fullName, edt_address, edt_email, edt_id_card;
|
||||
private TextView signIn_textView, errorText, errorTextDistrictWard;
|
||||
private Spinner wardSpinner, districtSpinner;
|
||||
private ImageView back_image;
|
||||
private MaterialButton signUpButton;
|
||||
private ConstraintLayout progressLayout;
|
||||
private String email, phone, name, dateOfBirth, address, district, ward, password = null;
|
||||
private String email, phone, name, dateOfBirth, address, district, ward, password = null, identifiedCode;
|
||||
|
||||
private static final ArrayList<String> wardList = new ArrayList<>();
|
||||
private static final ArrayList<String> districtList = new ArrayList<>();
|
||||
@@ -74,6 +74,7 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
textInput_fullName = (TextInputLayout) findViewById(R.id.textInput_fullName);
|
||||
textInput_birthDay = (TextInputLayout) findViewById(R.id.textInput_birthDay);
|
||||
textInput_email = findViewById(R.id.textInput_email);
|
||||
textInput_id_card = findViewById(R.id.textInput_id_card);
|
||||
|
||||
signUpButton = findViewById(R.id.sign_up_button);
|
||||
|
||||
@@ -84,6 +85,7 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
edt_fullName = findViewById(R.id.edt_fullName);
|
||||
edt_address = findViewById(R.id.edt_address);
|
||||
edt_email = findViewById(R.id.edt_email);
|
||||
edt_id_card = findViewById(R.id.edt_id_card);
|
||||
|
||||
districtSpinner = (Spinner) findViewById(R.id.district);
|
||||
wardSpinner = (Spinner) findViewById(R.id.ward);
|
||||
@@ -166,7 +168,7 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
user.setDateOfBirth(dateOfBirth);
|
||||
user.setEmail(email);
|
||||
user.setFullName(name);
|
||||
user.setIdentifiedCode("");
|
||||
user.setIdentifiedCode(identifiedCode);
|
||||
user.setImageUrl("");
|
||||
user.setLocked(false);
|
||||
user.setPhoneNumber(phone);
|
||||
@@ -239,6 +241,14 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
textInput_fullName.setErrorEnabled(false);
|
||||
}
|
||||
|
||||
//Check identified Code
|
||||
if(identifiedCode.length() < 9 && identifiedCode.length() > 10){
|
||||
textInput_id_card.setError("CCCD / CMND không hợp lệ!");
|
||||
dataHasValidate = false;
|
||||
} else {
|
||||
textInput_id_card.setErrorEnabled(false);
|
||||
}
|
||||
|
||||
//Check birthday
|
||||
if(dateOfBirth.isEmpty()){
|
||||
textInput_birthDay.setError("Ngày tháng năm sinh của bạn còn trống!");
|
||||
@@ -306,6 +316,7 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
district = districtSpinner.getSelectedItem().toString();
|
||||
ward = wardSpinner.getSelectedItem().toString();
|
||||
password = edt_confirmPassword.getText().toString();
|
||||
identifiedCode = edt_id_card.getText().toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -503,7 +514,6 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
textInput_fullName.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_birthDay.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_email.setTypeface(Common.setFontBebas(getAssets()));
|
||||
|
||||
edt_birthday.setTypeface(Common.setFontBebas(getAssets()));
|
||||
textInput_id_card.setTypeface(Common.setFontBebas(getAssets()));
|
||||
}
|
||||
}
|
||||
@@ -244,13 +244,15 @@ public class VerifyAccountActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onResponse(Call<User> call, Response<User> response) {
|
||||
|
||||
|
||||
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
//Create user success;
|
||||
Toast.makeText(VerifyAccountActivity.this, "Tạo tài khoản thành công!", Toast.LENGTH_SHORT).show();
|
||||
startActivity(new Intent(VerifyAccountActivity.this, SignInActivity.class));
|
||||
finish();
|
||||
if(response.code() == 200){
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
//Create user success;
|
||||
Toast.makeText(VerifyAccountActivity.this, "Tạo tài khoản thành công!", Toast.LENGTH_SHORT).show();
|
||||
startActivity(new Intent(VerifyAccountActivity.this, SignInActivity.class));
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(VerifyAccountActivity.this, "Lỗi hệ thống! Code: " + response.code(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.capstone.foodify.API.FoodApiToken;
|
||||
import com.capstone.foodify.Fragment.HomeFragment;
|
||||
import com.capstone.foodify.Model.Basket;
|
||||
import com.capstone.foodify.Model.User;
|
||||
import com.google.firebase.auth.FirebaseUser;
|
||||
import com.thecode.aestheticdialogs.AestheticDialog;
|
||||
import com.thecode.aestheticdialogs.DialogStyle;
|
||||
import com.thecode.aestheticdialogs.DialogType;
|
||||
@@ -31,6 +32,7 @@ import retrofit2.Callback;
|
||||
import retrofit2.Response;
|
||||
|
||||
public class Common {
|
||||
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";
|
||||
|
||||
@@ -49,9 +49,6 @@ public class ProfileFragment extends Fragment {
|
||||
|
||||
popupDialog = PopupDialog.getInstance(getContext());
|
||||
|
||||
//Set user name on textview
|
||||
user_name.setText(Common.CURRENT_USER.getFullName());
|
||||
|
||||
//Set image for user
|
||||
if(Common.CURRENT_USER.getImageUrl().isEmpty()){
|
||||
profile_avatar.setImageResource(R.drawable.profile_avatar);
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<vector android:height="30dp" android:viewportHeight="24"
|
||||
android:viewportWidth="24" android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="m21.5,21h-19c-1.378,0 -2.5,-1.122 -2.5,-2.5v-13c0,-1.378 1.122,-2.5 2.5,-2.5h19c1.378,0 2.5,1.122 2.5,2.5v13c0,1.378 -1.122,2.5 -2.5,2.5zM2.5,4c-0.827,0 -1.5,0.673 -1.5,1.5v13c0,0.827 0.673,1.5 1.5,1.5h19c0.827,0 1.5,-0.673 1.5,-1.5v-13c0,-0.827 -0.673,-1.5 -1.5,-1.5z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m7.5,12c-1.378,0 -2.5,-1.122 -2.5,-2.5s1.122,-2.5 2.5,-2.5 2.5,1.122 2.5,2.5 -1.122,2.5 -2.5,2.5zM7.5,8c-0.827,0 -1.5,0.673 -1.5,1.5s0.673,1.5 1.5,1.5 1.5,-0.673 1.5,-1.5 -0.673,-1.5 -1.5,-1.5z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m11.5,17c-0.276,0 -0.5,-0.224 -0.5,-0.5v-1c0,-0.827 -0.673,-1.5 -1.5,-1.5h-4c-0.827,0 -1.5,0.673 -1.5,1.5v1c0,0.276 -0.224,0.5 -0.5,0.5s-0.5,-0.224 -0.5,-0.5v-1c0,-1.378 1.122,-2.5 2.5,-2.5h4c1.378,0 2.5,1.122 2.5,2.5v1c0,0.276 -0.224,0.5 -0.5,0.5z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m20.5,9h-6c-0.276,0 -0.5,-0.224 -0.5,-0.5s0.224,-0.5 0.5,-0.5h6c0.276,0 0.5,0.224 0.5,0.5s-0.224,0.5 -0.5,0.5z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m20.5,13h-6c-0.276,0 -0.5,-0.224 -0.5,-0.5s0.224,-0.5 0.5,-0.5h6c0.276,0 0.5,0.224 0.5,0.5s-0.224,0.5 -0.5,0.5z"/>
|
||||
<path android:fillColor="#FF000000" android:pathData="m20.5,17h-6c-0.276,0 -0.5,-0.224 -0.5,-0.5s0.224,-0.5 0.5,-0.5h6c0.276,0 0.5,0.224 0.5,0.5s-0.224,0.5 -0.5,0.5z"/>
|
||||
</vector>
|
||||
@@ -64,7 +64,7 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_email"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
@@ -88,7 +88,7 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_phone"
|
||||
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="20dp"
|
||||
@@ -112,7 +112,7 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_fullName"
|
||||
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="20dp"
|
||||
@@ -135,7 +135,7 @@
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_birthDay"
|
||||
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"
|
||||
|
||||
@@ -35,80 +35,89 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/back_image" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_old_password"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:hint="@string/old_password"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textInput_password"
|
||||
app:passwordToggleEnabled="true"
|
||||
app:passwordToggleTint="@color/primaryColor"
|
||||
app:startIconDrawable="@drawable/baseline_vpn_key_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:id="@+id/layout_change_password"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_old_password"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_old_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_marginBottom="20dp"
|
||||
android:hint="@string/old_password"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+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.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_old_password"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textPassword" />
|
||||
|
||||
<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_marginBottom="20dp"
|
||||
android:hint="@string/password_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textInput_password_confirm"
|
||||
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_marginBottom="20dp"
|
||||
android:hint="@string/password_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textInput_password_confirm"
|
||||
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" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_password_confirm"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="100dp"
|
||||
android:hint="@string/repeat_password_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/change_password_button"
|
||||
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_confirmPassword"
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_password_confirm"
|
||||
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:hint="@string/repeat_password_text"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
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_confirmPassword"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="textPassword" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/change_password_button"
|
||||
@@ -117,12 +126,12 @@
|
||||
android:text="@string/change_password"
|
||||
android:textSize="20sp"
|
||||
android:padding="10dp"
|
||||
android:layout_marginTop="80dp"
|
||||
android:layout_marginStart="40dp"
|
||||
android:layout_marginEnd="40dp"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/layout_change_password"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
|
||||
@@ -6,80 +6,110 @@
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Activity.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="90dp"
|
||||
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/opensans"
|
||||
android:textColor="@color/gray"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="25dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_account"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:hint="@string/phone"
|
||||
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">
|
||||
android:layout_height="match_parent"
|
||||
android:clickable="false"
|
||||
>
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_email"
|
||||
<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="90dp"
|
||||
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/opensans"
|
||||
android:textColor="@color/gray"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="25dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textView" />
|
||||
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="text" />
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginBottom="40dp"
|
||||
android:layout_marginTop="50dp"
|
||||
android:hint="@string/phone"
|
||||
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.TextInputLayout>
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_phone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="phone" />
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/send_code_button"
|
||||
style="@style/DefaultSolid"
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/send_code_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_phone" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
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" />
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80000000"
|
||||
android:id="@+id/progress_layout"
|
||||
android:clickable="true"
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBarLoadData"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:indeterminateTint="@color/primaryColor"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -100,6 +100,28 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_id_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:hint="CCCD / CMND"
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_fullName"
|
||||
app:startIconDrawable="@drawable/id_card"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/edt_id_card"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:inputType="text" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/textInput_birthDay"
|
||||
android:layout_width="match_parent"
|
||||
@@ -111,7 +133,7 @@
|
||||
app:boxBackgroundColor="@color/white"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_fullName"
|
||||
app:layout_constraintTop_toBottomOf="@+id/textInput_id_card"
|
||||
app:startIconDrawable="@drawable/baseline_calendar_month_24"
|
||||
app:startIconTint="@color/primaryColor">
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<string name="phone">số điện thoại</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>
|
||||
<string name="forgot_password_description">Chúng tôi sẽ gửi mã xác nhận qua số điện thoại của bạn.</string>
|
||||
<string name="confirm_code">mã xác nhận</string>
|
||||
<string name="confirm_code_description">Chúng tôi đã gửi tin mã xác nhận qua số điện thoại của bạn.</string>
|
||||
<string name="did_not_receive_code">Chưa nhận được mã?</string>
|
||||
|
||||
Reference in New Issue
Block a user