mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Acc verify phone method
This commit is contained in:
@@ -73,6 +73,8 @@ dependencies {
|
||||
implementation 'com.github.gabriel-TheCode:AestheticDialogs:1.3.6'
|
||||
implementation 'io.github.pilgr:paperdb:2.7.2'
|
||||
|
||||
implementation 'androidx.browser:browser:1.5.0'
|
||||
|
||||
//Firebase
|
||||
implementation platform('com.google.firebase:firebase-bom:31.2.3')
|
||||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||
|
||||
@@ -2,9 +2,20 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.telephony"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_SMS" />
|
||||
<uses-permission android:name="android.permission.READ_SMS" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
@@ -46,7 +57,7 @@
|
||||
android:exported="false"
|
||||
android:noHistory="true" />
|
||||
<activity
|
||||
android:name=".Activity.SendEmailActivity"
|
||||
android:name=".Activity.VerifyAccountActivity"
|
||||
android:exported="false"
|
||||
android:noHistory="true" />
|
||||
<activity
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.capstone.foodify.Activity;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
@@ -37,7 +36,7 @@ public class ForgotPasswordActivity extends AppCompatActivity {
|
||||
send_code_button.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(ForgotPasswordActivity.this, SendEmailActivity.class));
|
||||
startActivity(new Intent(ForgotPasswordActivity.this, VerifyAccountActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
package com.capstone.foodify.Activity;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.capstone.foodify.R;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
|
||||
public class SendEmailActivity extends AppCompatActivity {
|
||||
|
||||
ImageView close_image;
|
||||
MaterialButton confirm_code;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_send_email);
|
||||
|
||||
initComponent();
|
||||
|
||||
confirm_code.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
startActivity(new Intent(SendEmailActivity.this, ResetPasswordActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
close_image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
onBackPressed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initComponent() {
|
||||
confirm_code = (MaterialButton) findViewById(R.id.confirm_code);
|
||||
close_image = (ImageView) findViewById(R.id.close_image);
|
||||
}
|
||||
}
|
||||
@@ -91,6 +91,8 @@ public class SignInActivity extends AppCompatActivity {
|
||||
popupDialog.setStyle(Styles.PROGRESS).setProgressDialogTint(getResources().getColor(R.color.primaryColor, null))
|
||||
.setCancelable(false).showDialog();
|
||||
|
||||
mAuth.setLanguageCode("vi");
|
||||
|
||||
mAuth.signInWithEmailAndPassword(email.getText().toString(), password.getText().toString())
|
||||
.addOnCompleteListener(SignInActivity.this, new OnCompleteListener<AuthResult>() {
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.capstone.foodify.Activity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.content.Context;
|
||||
@@ -22,13 +24,22 @@ import com.capstone.foodify.API.FoodApi;
|
||||
import com.capstone.foodify.Common;
|
||||
import com.capstone.foodify.Model.DistrictWard.DistrictWardResponse;
|
||||
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 com.saadahmedsoft.popupdialog.PopupDialog;
|
||||
import com.saadahmedsoft.popupdialog.Styles;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import retrofit2.Call;
|
||||
import retrofit2.Callback;
|
||||
@@ -36,20 +47,20 @@ import retrofit2.Response;
|
||||
|
||||
public class SignUpActivity extends AppCompatActivity {
|
||||
|
||||
private static final String PHONE_CODE = "+84";
|
||||
TextInputLayout textInput_email, textInput_password, textInput_phone,
|
||||
textInput_address, textInput_repeatPassword, textInput_fullName, textInput_birthDay;
|
||||
final Calendar myCalendar= Calendar.getInstance();
|
||||
EditText edt_birthday;
|
||||
TextView signIn_textView;
|
||||
EditText edt_birthday, edt_phone;
|
||||
TextView signIn_textView, errorText;
|
||||
Spinner wardSpinner, districtSpinner;
|
||||
ImageView back_image;
|
||||
MaterialButton signUpButton;
|
||||
ConstraintLayout progressLayout;
|
||||
|
||||
private static final ArrayList<String> wardList = new ArrayList<>();
|
||||
private static final ArrayList<String> districtList = new ArrayList<>();
|
||||
|
||||
String selectedDistrict = "";
|
||||
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -91,9 +102,68 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//Set event for sign up button
|
||||
signUpButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
loading();
|
||||
signUp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void initComponent() {
|
||||
private void signUp(){
|
||||
FirebaseAuth auth = FirebaseAuth.getInstance();
|
||||
PhoneAuthOptions options = PhoneAuthOptions.newBuilder(auth)
|
||||
.setPhoneNumber(PHONE_CODE + edt_phone.getText().toString())
|
||||
.setTimeout(60L, TimeUnit.SECONDS)
|
||||
.setActivity(this)
|
||||
.setCallbacks(new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
|
||||
@Override
|
||||
public void onCodeSent(@NonNull String verificationId,
|
||||
@NonNull PhoneAuthProvider.ForceResendingToken forceResendingToken) {
|
||||
loadCompleted();
|
||||
|
||||
Intent intent = new Intent(SignUpActivity.this, VerifyAccountActivity.class);
|
||||
intent.putExtra("phone", edt_phone.getText().toString());
|
||||
intent.putExtra("verificationId", verificationId);
|
||||
intent.putExtra("token", forceResendingToken);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationCompleted(@NonNull PhoneAuthCredential phoneAuthCredential) {
|
||||
loadCompleted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationFailed(@NonNull FirebaseException e) {
|
||||
// ...
|
||||
loadCompleted();
|
||||
showError(e.toString());
|
||||
}
|
||||
})
|
||||
.build();
|
||||
PhoneAuthProvider.verifyPhoneNumber(options);
|
||||
// [END auth_test_phone_verify]
|
||||
}
|
||||
|
||||
private void showError(String msg){
|
||||
errorText.setText(msg);
|
||||
}
|
||||
|
||||
private void loading(){
|
||||
progressLayout.setVisibility(View.VISIBLE);
|
||||
signUpButton.setEnabled(false);
|
||||
}
|
||||
|
||||
private void loadCompleted(){
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
signUpButton.setEnabled(true);
|
||||
}
|
||||
private void initComponent() {
|
||||
textInput_email= (TextInputLayout) findViewById(R.id.textInput_email);
|
||||
textInput_password = (TextInputLayout) findViewById(R.id.textInput_password);
|
||||
textInput_phone = (TextInputLayout) findViewById(R.id.textInput_phone);
|
||||
@@ -102,15 +172,21 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
textInput_fullName = (TextInputLayout) findViewById(R.id.textInput_fullName);
|
||||
textInput_birthDay = (TextInputLayout) findViewById(R.id.textInput_birthDay);
|
||||
|
||||
signUpButton = findViewById(R.id.sign_up_button);
|
||||
|
||||
edt_birthday = (EditText) findViewById(R.id.edt_birthDay);
|
||||
edt_phone = findViewById(R.id.edt_phone);
|
||||
|
||||
districtSpinner = (Spinner) findViewById(R.id.district);
|
||||
wardSpinner = (Spinner) findViewById(R.id.ward);
|
||||
|
||||
signIn_textView = (TextView) findViewById(R.id.signIn_textView);
|
||||
errorText = findViewById(R.id.errorText);
|
||||
|
||||
back_image = (ImageView) findViewById(R.id.back_image);
|
||||
|
||||
progressLayout = findViewById(R.id.progress_layout);
|
||||
|
||||
}
|
||||
|
||||
private void getListDistrict() {
|
||||
|
||||
@@ -0,0 +1,311 @@
|
||||
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.os.CountDownTimer;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
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.firebase.FirebaseException;
|
||||
import com.google.firebase.auth.AuthResult;
|
||||
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.saadahmedsoft.popupdialog.PopupDialog;
|
||||
import com.saadahmedsoft.popupdialog.Styles;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class VerifyAccountActivity extends AppCompatActivity {
|
||||
private static final String PHONE_CODE = "+84";
|
||||
|
||||
private EditText inputCode1, inputCode2, inputCode3, inputCode4, inputCode5, inputCode6;
|
||||
ImageView close_image;
|
||||
MaterialButton confirm_code;
|
||||
String verificationId, phone = null;
|
||||
ConstraintLayout progressLayout;
|
||||
TextView resendCodeText, resendCodeTextButton, countDown, errorText;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_verify_account);
|
||||
|
||||
initComponent();
|
||||
|
||||
//Get code
|
||||
if(getIntent() != null){
|
||||
verificationId = getIntent().getStringExtra("verificationId");
|
||||
phone = getIntent().getStringExtra("phone");
|
||||
}
|
||||
|
||||
|
||||
//Init text changedListener
|
||||
textChangedListenerEditTextOTP();
|
||||
|
||||
//Add event to confirm button
|
||||
confirm_code.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
confirmCode();
|
||||
}
|
||||
});
|
||||
|
||||
//Add event to close icon
|
||||
close_image.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(VerifyAccountActivity.this, SignUpActivity.class));
|
||||
}
|
||||
});
|
||||
|
||||
//Count down resend code
|
||||
CountDownTimer count = new CountDownTimer(60000, 1000) {
|
||||
@Override
|
||||
public void onTick(long millisUntilFinished) {
|
||||
countDown.setText(millisUntilFinished / 1000 + " giây");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
showResendCode();
|
||||
}
|
||||
};
|
||||
count.start();
|
||||
|
||||
//Add event to resend button
|
||||
resendCodeTextButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
hideResendCode();
|
||||
resendCode(phone);
|
||||
count.start();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showResendCode(){
|
||||
resendCodeTextButton.setVisibility(View.VISIBLE);
|
||||
|
||||
resendCodeText.setVisibility(View.GONE);
|
||||
countDown.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
private void hideResendCode(){
|
||||
resendCodeTextButton.setVisibility(View.GONE);
|
||||
|
||||
resendCodeText.setVisibility(View.VISIBLE);
|
||||
countDown.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
private void resendCode(String phone){
|
||||
PhoneAuthOptions options = PhoneAuthOptions
|
||||
.newBuilder(FirebaseAuth.getInstance())
|
||||
.setActivity(VerifyAccountActivity.this)
|
||||
.setPhoneNumber(PHONE_CODE + phone)
|
||||
.setTimeout(60L, TimeUnit.SECONDS)
|
||||
.setCallbacks(new PhoneAuthProvider.OnVerificationStateChangedCallbacks() {
|
||||
@Override
|
||||
public void onVerificationCompleted(PhoneAuthCredential phoneAuthCredential) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onVerificationFailed(FirebaseException e) {
|
||||
Toast.makeText(VerifyAccountActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeSent(String newVerificationId, PhoneAuthProvider.ForceResendingToken forceResendingToken) {
|
||||
verificationId = newVerificationId;
|
||||
Toast.makeText(VerifyAccountActivity.this, "Mã OTP đã được gửi!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
})
|
||||
.build();
|
||||
PhoneAuthProvider.verifyPhoneNumber(options);
|
||||
}
|
||||
|
||||
private void confirmCode(){
|
||||
if(inputCode1.getText().toString().trim().isEmpty()
|
||||
|| inputCode2.getText().toString().trim().isEmpty()
|
||||
|| inputCode3.getText().toString().trim().isEmpty()
|
||||
|| inputCode4.getText().toString().trim().isEmpty()
|
||||
|| inputCode5.getText().toString().trim().isEmpty()
|
||||
|| inputCode6.getText().toString().trim().isEmpty()) {
|
||||
Toast.makeText(VerifyAccountActivity.this, "Mã code không đúng định dạng!", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
String code =
|
||||
inputCode1.getText().toString() +
|
||||
inputCode2.getText().toString() +
|
||||
inputCode3.getText().toString() +
|
||||
inputCode4.getText().toString() +
|
||||
inputCode5.getText().toString() +
|
||||
inputCode6.getText().toString();
|
||||
if(verificationId != null) {
|
||||
//Show progress bar
|
||||
progressLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
PhoneAuthCredential phoneAuthCredential = PhoneAuthProvider.getCredential(
|
||||
verificationId,
|
||||
code
|
||||
);
|
||||
FirebaseAuth.getInstance().signInWithCredential(phoneAuthCredential)
|
||||
.addOnCompleteListener(new OnCompleteListener<AuthResult>() {
|
||||
@Override
|
||||
public void onComplete(@NonNull Task<AuthResult> task) {
|
||||
//Dismiss progress layout
|
||||
progressLayout.setVisibility(View.GONE);
|
||||
|
||||
if(task.isSuccessful()) {
|
||||
|
||||
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));
|
||||
} else {
|
||||
Toast.makeText(VerifyAccountActivity.this, "Mã code không đúng. Vui lòng kiểm tra lại!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void showErrorText(String msg){
|
||||
errorText.setText(msg);
|
||||
}
|
||||
|
||||
private void textChangedListenerEditTextOTP(){
|
||||
inputCode1.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode1.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode2.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode2.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode2.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode3.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode3.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode3.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode4.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode4.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode4.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode5.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
|
||||
inputCode5.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
if(inputCode5.getText().toString().length()== 0) //size as per your requirement
|
||||
{
|
||||
inputCode6.requestFocus();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
// Nothing to do
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Nothing to do
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initComponent() {
|
||||
confirm_code = (MaterialButton) findViewById(R.id.confirm_code);
|
||||
close_image = (ImageView) findViewById(R.id.close_image);
|
||||
|
||||
inputCode1 = findViewById(R.id.inputCode1);
|
||||
inputCode2 = findViewById(R.id.inputCode2);
|
||||
inputCode3 = findViewById(R.id.inputCode3);
|
||||
inputCode4 = findViewById(R.id.inputCode4);
|
||||
inputCode5 = findViewById(R.id.inputCode5);
|
||||
inputCode6 = findViewById(R.id.inputCode6);
|
||||
|
||||
progressLayout = findViewById(R.id.progress_layout);
|
||||
|
||||
resendCodeText = findViewById(R.id.textview_resendCode);
|
||||
resendCodeTextButton = findViewById(R.id.textview_resendCode_button);
|
||||
countDown = findViewById(R.id.textview_countdown);
|
||||
errorText = findViewById(R.id.errorText);
|
||||
}
|
||||
}
|
||||
@@ -228,6 +228,18 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/errorText"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@id/textInput_confirmPassword"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/sign_up_button"
|
||||
style="@style/DefaultSolid"
|
||||
@@ -275,7 +287,26 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80000000"
|
||||
android:id="@+id/progress_layout"
|
||||
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>
|
||||
+62
-14
@@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".Activity.SendEmailActivity">
|
||||
tools:context=".Activity.VerifyAccountActivity">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_image"
|
||||
@@ -150,30 +150,28 @@
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_countdown"
|
||||
android:id="@+id/errorText"
|
||||
android:textSize="12sp"
|
||||
android:textColor="@color/red"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:text="00:35"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/secondary"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginBottom="30dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textview1"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintBottom_toTopOf="@id/textview1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dp"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:text="@string/did_not_receive_code"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toTopOf="@+id/textview_resendCode"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:layout_marginStart="20dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/confirm_code"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
@@ -181,13 +179,42 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:text="Gửi lại sau: "
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
android:layout_margin="20dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/confirm_code"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_countdown"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:text="00:35"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:textColor="@color/secondary"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toEndOf="@id/textview_resendCode"
|
||||
app:layout_constraintBottom_toTopOf="@+id/confirm_code"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/textview_resendCode_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="15sp"
|
||||
android:text="@string/resend_code"
|
||||
android:fontFamily="@font/opensans"
|
||||
android:textColor="@color/primaryColor"
|
||||
android:textStyle="bold"
|
||||
android:layout_margin="20dp"
|
||||
app:layout_constraintBottom_toTopOf="@+id/confirm_code"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/confirm_code"
|
||||
@@ -203,4 +230,25 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#80000000"
|
||||
android:id="@+id/progress_layout"
|
||||
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>
|
||||
@@ -23,7 +23,7 @@
|
||||
<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="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 email của bạ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>
|
||||
<string name="resend_code">Gửi lại</string>
|
||||
<string name="confirm">Xác nhận</string>
|
||||
|
||||
Reference in New Issue
Block a user