mirror of
https://github.com/Nezumi-2711/PRM392.git
synced 2026-09-22 13:48:29 +00:00
Add information page
This commit is contained in:
@@ -10,7 +10,7 @@ android {
|
|||||||
minSdk 23
|
minSdk 23
|
||||||
targetSdk 30
|
targetSdk 30
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "97.2"
|
versionName "98.0"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,13 +23,16 @@
|
|||||||
android:theme="@style/Theme.Foodify"
|
android:theme="@style/Theme.Foodify"
|
||||||
tools:replace="android:theme"
|
tools:replace="android:theme"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name=".InformationUser"
|
||||||
|
android:exported="false"/>
|
||||||
|
|
||||||
<receiver android:name=".OTP_Receiver">
|
<receiver android:name=".OTP_Receiver">
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
|
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</receiver>
|
</receiver>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".OrderStatusDetail"
|
android:name=".OrderStatusDetail"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
@@ -61,16 +64,15 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ChangePassword"
|
android:name=".ChangePassword"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:theme="@style/Theme.Foodify.NoActionBar"
|
android:theme="@style/Theme.Foodify.NoActionBar" />
|
||||||
/>
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ForgotPassword"
|
android:name=".ForgotPassword"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:theme="@style/Theme.Foodify.NoActionBar"/>
|
android:theme="@style/Theme.Foodify.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".VerifyPhone"
|
android:name=".VerifyPhone"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:theme="@style/Theme.Foodify.NoActionBar"/>
|
android:theme="@style/Theme.Foodify.NoActionBar" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".OrderStatus"
|
android:name=".OrderStatus"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ public class Cart extends AppCompatActivity implements RecyclerItemTouchHelperLi
|
|||||||
} else {
|
} else {
|
||||||
edtAddress.setText("");
|
edtAddress.setText("");
|
||||||
edtAddress.setEnabled(false);
|
edtAddress.setEnabled(false);
|
||||||
Toast.makeText(Cart.this, "Vui lòng điền địa chỉ mặc định của bạn!", Toast.LENGTH_SHORT).show();
|
Toast.makeText(Cart.this, "Địa chỉ mặc định chưa có sẵn! Vui lòng điền địa chỉ mặc định trong thông tin cá nhân!", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ import java.util.Locale;
|
|||||||
public class Common {
|
public class Common {
|
||||||
public static User currentUser;
|
public static User currentUser;
|
||||||
|
|
||||||
|
public final static String PASSWORD_PATTERN = "^(?=.*[0-9])(?=.*[A-Z])(?=.*[@#$%^&+=!_])(?=\\S+$).{4,}$";
|
||||||
|
|
||||||
public static String versionAppNewest = "";
|
public static String versionAppNewest = "";
|
||||||
public static String changelog = "";
|
public static String changelog = "";
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
|||||||
FirebaseDatabase database;
|
FirebaseDatabase database;
|
||||||
DatabaseReference category;
|
DatabaseReference category;
|
||||||
|
|
||||||
final String PASSWORD_PATTERN = "^(?=.*[0-9])(?=.*[A-Z])(?=.*[@#$%^&+=!_])(?=\\S+$).{4,}$";
|
|
||||||
|
|
||||||
RecyclerView recyler_menu;
|
RecyclerView recyler_menu;
|
||||||
FirebaseRecyclerAdapter<Category, MenuViewHolder> adapter;
|
FirebaseRecyclerAdapter<Category, MenuViewHolder> adapter;
|
||||||
@@ -105,6 +105,8 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
|||||||
|
|
||||||
DownloadManager manager = null;
|
DownloadManager manager = null;
|
||||||
|
|
||||||
|
TextView navUserName;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
@@ -241,7 +243,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
|||||||
|
|
||||||
//Set name for user
|
//Set name for user
|
||||||
View headerView = navigationView.getHeaderView(0);
|
View headerView = navigationView.getHeaderView(0);
|
||||||
TextView navUserName = (TextView) headerView.findViewById(R.id.txtFullName);
|
navUserName = (TextView) headerView.findViewById(R.id.txtFullName);
|
||||||
navUserName.setText("Xin chào " + Common.currentUser.getName() + "!");
|
navUserName.setText("Xin chào " + Common.currentUser.getName() + "!");
|
||||||
|
|
||||||
updateToken(FirebaseInstanceId.getInstance().getToken());
|
updateToken(FirebaseInstanceId.getInstance().getToken());
|
||||||
@@ -432,6 +434,7 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
adapter.startListening();
|
adapter.startListening();
|
||||||
|
navUserName.setText("Xin chào " + Common.currentUser.getName() + "!");
|
||||||
fab.setCount(new Database(this).getCountCart(Common.currentUser.getPhone()));
|
fab.setCount(new Database(this).getCountCart(Common.currentUser.getPhone()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -462,10 +465,8 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
|||||||
} else if (id == R.id.nav_order) {
|
} else if (id == R.id.nav_order) {
|
||||||
Intent orderIntent = new Intent(Home.this, OrderStatus.class);
|
Intent orderIntent = new Intent(Home.this, OrderStatus.class);
|
||||||
startActivity(orderIntent);
|
startActivity(orderIntent);
|
||||||
} else if (id == R.id.nav_change_pwd) {
|
} else if (id == R.id.nav_information) {
|
||||||
showChangePasswordDialog();
|
startActivity(new Intent(Home.this, InformationUser.class));
|
||||||
} else if (id == R.id.nav_home_address) {
|
|
||||||
showHomeAddressDialog();
|
|
||||||
} else if (id == R.id.nav_setting) {
|
} else if (id == R.id.nav_setting) {
|
||||||
showSettingDialog();
|
showSettingDialog();
|
||||||
} else if (id == R.id.nav_favorites) {
|
} else if (id == R.id.nav_favorites) {
|
||||||
@@ -570,95 +571,6 @@ public class Home extends AppCompatActivity implements NavigationView.OnNavigati
|
|||||||
alertDialog.show();
|
alertDialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showChangePasswordDialog() {
|
|
||||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(Home.this);
|
|
||||||
alertDialog.setTitle("Đổi mật khẩu");
|
|
||||||
alertDialog.setMessage("Vui lòng điền đầy đủ thông tin");
|
|
||||||
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(this);
|
|
||||||
View layout_pwd = inflater.inflate(R.layout.change_password_layout, null);
|
|
||||||
|
|
||||||
MaterialEditText edtPassword = (MaterialEditText) layout_pwd.findViewById(R.id.edtPassword);
|
|
||||||
MaterialEditText edtNewPassword = (MaterialEditText) layout_pwd.findViewById(R.id.edtNewPassword);
|
|
||||||
MaterialEditText edtRepeatPassword = (MaterialEditText) layout_pwd.findViewById(R.id.edtRepeatPassword);
|
|
||||||
|
|
||||||
alertDialog.setView(layout_pwd);
|
|
||||||
|
|
||||||
alertDialog.setPositiveButton("Đổi mật khẩu", null);
|
|
||||||
|
|
||||||
AlertDialog d = alertDialog.create();
|
|
||||||
d.setOnShowListener(new DialogInterface.OnShowListener() {
|
|
||||||
@Override
|
|
||||||
public void onShow(DialogInterface dialog) {
|
|
||||||
Button changePassword = d.getButton(AlertDialog.BUTTON_POSITIVE);
|
|
||||||
changePassword.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View v) {
|
|
||||||
android.app.AlertDialog waitingDialog = new SpotsDialog(Home.this);
|
|
||||||
waitingDialog.show();
|
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(edtPassword.getText().toString()) && !TextUtils.isEmpty(edtNewPassword.getText().toString()) && !TextUtils.isEmpty(edtRepeatPassword.getText().toString())) {
|
|
||||||
//Verify password
|
|
||||||
Pattern patternPassword = Pattern.compile(PASSWORD_PATTERN);
|
|
||||||
Matcher matcherPassword = patternPassword.matcher(edtRepeatPassword.getText().toString());
|
|
||||||
|
|
||||||
if (matcherPassword.matches() && edtRepeatPassword.getText().toString().length() >= 8) {
|
|
||||||
//Check old password
|
|
||||||
if (edtPassword.getText().toString().equals(Common.currentUser.getPassword())) {
|
|
||||||
|
|
||||||
//Check new password and repeat password
|
|
||||||
if (edtNewPassword.getText().toString().equals(edtRepeatPassword.getText().toString())) {
|
|
||||||
Map<String, Object> passwordUpdate = new HashMap<>();
|
|
||||||
passwordUpdate.put("password", edtNewPassword.getText().toString());
|
|
||||||
|
|
||||||
//Make update
|
|
||||||
DatabaseReference user = FirebaseDatabase.getInstance().getReference("User");
|
|
||||||
user.child(Common.currentUser.getPhone())
|
|
||||||
.updateChildren(passwordUpdate)
|
|
||||||
.addOnCompleteListener(new OnCompleteListener<Void>() {
|
|
||||||
@Override
|
|
||||||
public void onComplete(@NonNull Task<Void> task) {
|
|
||||||
waitingDialog.dismiss();
|
|
||||||
Common.currentUser.setPassword(edtNewPassword.getText().toString());
|
|
||||||
Toast.makeText(Home.this, "Mật khẩu đã được cập nhật!", Toast.LENGTH_SHORT).show();
|
|
||||||
d.dismiss();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.addOnFailureListener(new OnFailureListener() {
|
|
||||||
@Override
|
|
||||||
public void onFailure(@NonNull Exception e) {
|
|
||||||
Toast.makeText(Home.this, "Đã xảy ra lỗi hệ thống: " + e.getMessage(), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
waitingDialog.dismiss();
|
|
||||||
edtRepeatPassword.setError("Mật khẩu chưa khớp! Vui lòng thử lại!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
waitingDialog.dismiss();
|
|
||||||
edtPassword.setError("Sai mật khẩu, vui lòng thử lại!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
waitingDialog.dismiss();
|
|
||||||
Toast.makeText(Home.this, "Mật khẩu của bạn cần tối thiểu có 8 ký tự, 1 ký tự viết hoa, 1 số và 1 ký tự đặc biệt!", Toast.LENGTH_LONG).show();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
waitingDialog.dismiss();
|
|
||||||
if (TextUtils.isEmpty(edtPassword.getText().toString())) {
|
|
||||||
edtPassword.setError("Vui lòng điền vào trường này!");
|
|
||||||
} else if (TextUtils.isEmpty(edtNewPassword.getText().toString())) {
|
|
||||||
edtNewPassword.setError("Vui lòng điền vào trường này!");
|
|
||||||
} else if (TextUtils.isEmpty(edtRepeatPassword.getText().toString())) {
|
|
||||||
edtRepeatPassword.setError("Vui lòng điền vào trường này!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
d.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu; this adds items to the action bar if it is present.
|
// Inflate the menu; this adds items to the action bar if it is present.
|
||||||
|
|||||||
@@ -0,0 +1,164 @@
|
|||||||
|
package com.waterbase.foodify;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.ActionBar;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.google.android.gms.tasks.OnCompleteListener;
|
||||||
|
import com.google.android.gms.tasks.OnFailureListener;
|
||||||
|
import com.google.android.gms.tasks.Task;
|
||||||
|
import com.google.firebase.database.DatabaseReference;
|
||||||
|
import com.google.firebase.database.FirebaseDatabase;
|
||||||
|
import com.waterbase.foodify.Common.Common;
|
||||||
|
import com.waterbase.foodify.Model.User;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
public class InformationUser extends AppCompatActivity {
|
||||||
|
|
||||||
|
TextView edtFullName, edtPhone, edtHomeAddress, edtOldPassword, edtPassword, edtNewPassword;
|
||||||
|
Button btnSave;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_information_user);
|
||||||
|
|
||||||
|
final ProgressBar progressBar = findViewById(R.id.progressBar);
|
||||||
|
|
||||||
|
edtFullName = findViewById(R.id.edtFullName);
|
||||||
|
edtPhone = findViewById(R.id.edtPhone);
|
||||||
|
edtHomeAddress = findViewById(R.id.edtHomeAddress);
|
||||||
|
edtOldPassword = findViewById(R.id.edtOldPassword);
|
||||||
|
edtPassword = findViewById(R.id.edtPassword);
|
||||||
|
edtNewPassword = findViewById(R.id.edtPasswordVerify);
|
||||||
|
|
||||||
|
btnSave = findViewById(R.id.btnSave);
|
||||||
|
|
||||||
|
//Load data
|
||||||
|
edtFullName.setText(Common.currentUser.getName());
|
||||||
|
edtPhone.setText(Common.currentUser.getPhone());
|
||||||
|
edtHomeAddress.setText(Common.currentUser.getHomeAddress());
|
||||||
|
|
||||||
|
btnSave.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
boolean verifyName = false, verifyHomeAddress = false, verifyPassword = false;
|
||||||
|
|
||||||
|
progressBar.setVisibility(View.VISIBLE);
|
||||||
|
btnSave.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
User user = new User();
|
||||||
|
|
||||||
|
//Validate Name
|
||||||
|
if (!TextUtils.isEmpty(edtFullName.getText().toString())) {
|
||||||
|
if (edtFullName.getText().toString().length() >= 8) {
|
||||||
|
user.setName(edtFullName.getText().toString());
|
||||||
|
verifyName = true;
|
||||||
|
} else {
|
||||||
|
edtFullName.setError("Vui lòng điền trường này với ít nhất là 8 ký tự!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
edtFullName.setError("Vui lòng không bỏ trống trường này!");
|
||||||
|
}
|
||||||
|
|
||||||
|
user.setPhone(edtPhone.getText().toString());
|
||||||
|
|
||||||
|
//Validate Home Address
|
||||||
|
if (!TextUtils.isEmpty(edtHomeAddress.getText().toString())) {
|
||||||
|
if (edtHomeAddress.getText().toString().length() >= 12) {
|
||||||
|
user.setHomeAddress(edtHomeAddress.getText().toString());
|
||||||
|
verifyHomeAddress = true;
|
||||||
|
} else {
|
||||||
|
edtHomeAddress.setError("Vui lòng điền trường này với ít nhất là 12 ký tự!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
verifyHomeAddress = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Validate Password
|
||||||
|
if (!TextUtils.isEmpty(edtOldPassword.getText().toString()) && !TextUtils.isEmpty(edtPassword.getText().toString()) && !TextUtils.isEmpty(edtNewPassword.getText().toString())) {
|
||||||
|
//Verify password
|
||||||
|
Pattern patternPassword = Pattern.compile(Common.PASSWORD_PATTERN);
|
||||||
|
Matcher matcherPassword = patternPassword.matcher(edtNewPassword.getText().toString());
|
||||||
|
|
||||||
|
if (matcherPassword.matches() && edtNewPassword.getText().toString().length() >= 8) {
|
||||||
|
//Check old password
|
||||||
|
if (Common.encryptPassword(edtOldPassword.getText().toString()).equals(Common.currentUser.getPassword())) {
|
||||||
|
|
||||||
|
//Check new password and repeat password
|
||||||
|
if (edtPassword.getText().toString().equals(edtNewPassword.getText().toString())) {
|
||||||
|
user.setPassword(Common.encryptPassword(edtNewPassword.getText().toString()));
|
||||||
|
verifyPassword = true;
|
||||||
|
} else {
|
||||||
|
edtNewPassword.setError("Mật khẩu chưa khớp! Vui lòng thử lại!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
edtOldPassword.setError("Sai mật khẩu, vui lòng thử lại!");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Toast.makeText(InformationUser.this, "Mật khẩu của bạn cần tối thiểu có 8 ký tự, 1 ký tự viết hoa, 1 số và 1 ký tự đặc biệt!", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
user.setPassword(Common.currentUser.getPassword());
|
||||||
|
verifyPassword = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (verifyName && verifyPassword && verifyHomeAddress) {
|
||||||
|
Common.currentUser = user;
|
||||||
|
FirebaseDatabase.getInstance().getReference("User")
|
||||||
|
.child(Common.currentUser.getPhone())
|
||||||
|
.setValue(user).addOnCompleteListener(new OnCompleteListener<Void>() {
|
||||||
|
@Override
|
||||||
|
public void onComplete(@NonNull Task<Void> task) {
|
||||||
|
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
btnSave.setVisibility(View.VISIBLE);
|
||||||
|
Toast.makeText(InformationUser.this, "Cập nhật thông tin thành công!", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
progressBar.setVisibility(View.GONE);
|
||||||
|
btnSave.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// calling the action bar
|
||||||
|
ActionBar actionBar = getSupportActionBar();
|
||||||
|
actionBar.setBackgroundDrawable(new ColorDrawable(0xFFFF5353));
|
||||||
|
actionBar.setTitle(Html.fromHtml("<font color='#ffffff'>Giỏ hàng</font>"));
|
||||||
|
|
||||||
|
// showing the back button in action bar
|
||||||
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
|
switch (item.getItemId()) {
|
||||||
|
case android.R.id.home:
|
||||||
|
this.finish();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -15,7 +15,6 @@ public class User implements Serializable {
|
|||||||
public User(String name, String password){
|
public User(String name, String password){
|
||||||
Name = name;
|
Name = name;
|
||||||
Password = password;
|
Password = password;
|
||||||
IsStaff = "false";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
|||||||
@@ -0,0 +1,202 @@
|
|||||||
|
<?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=".InformationUser">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imageView3"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:foreground="@drawable/foreground_design"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@drawable/bg4"
|
||||||
|
tools:layout_editor_absoluteX="0dp"
|
||||||
|
tools:layout_editor_absoluteY="-32dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/imgAvatar"
|
||||||
|
android:src="@drawable/avatar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/imageView3"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintVertical_bias=".05" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtViewInformation"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="Thông tin cá nhân"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="#FBFBFB"
|
||||||
|
android:textSize="19sp"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/imgAvatar" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edtFullName"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:backgroundTint="#CCCCCC"
|
||||||
|
android:drawableLeft="@drawable/ic_baseline_account_circle_24"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:hint="Họ và tên"
|
||||||
|
android:fontFamily="@font/regular"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#6DA3A3A3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtViewInformation"
|
||||||
|
app:layout_constraintWidth_percent=".8" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edtPhone"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="#CCCCCC"
|
||||||
|
android:drawableLeft="@drawable/ic_baseline_local_phone_24"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:enabled="false"
|
||||||
|
android:hint="Số điện thoại"
|
||||||
|
android:fontFamily="@font/regular"
|
||||||
|
android:maxLength="10"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#6DA3A3A3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/edtFullName"
|
||||||
|
app:layout_constraintWidth_percent=".8" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edtHomeAddress"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="#CCCCCC"
|
||||||
|
android:drawableLeft="@drawable/ic_baseline_home_24"
|
||||||
|
android:drawableTint="@color/white"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:hint="Địa chỉ mặc định"
|
||||||
|
android:fontFamily="@font/regular"
|
||||||
|
android:inputType="text"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#6DA3A3A3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/edtPhone"
|
||||||
|
app:layout_constraintWidth_percent=".8" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txtViewChangePassword"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:text="Đổi mật khẩu (Tuỳ chọn)"
|
||||||
|
android:textAlignment="center"
|
||||||
|
android:textColor="#FBFBFB"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:fontFamily="@font/italic"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/edtHomeAddress" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edtOldPassword"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="#CCCCCC"
|
||||||
|
android:drawableLeft="@drawable/ic_baseline_vpn_key_24"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:hint="Mật khẩu cũ"
|
||||||
|
android:fontFamily="@font/regular"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#6DA3A3A3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txtViewChangePassword"
|
||||||
|
app:layout_constraintWidth_percent=".8" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edtPassword"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:backgroundTint="#CCCCCC"
|
||||||
|
android:drawableLeft="@drawable/ic_baseline_vpn_key_24"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:fontFamily="@font/regular"
|
||||||
|
android:hint="Mật khẩu"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#6DA3A3A3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/edtOldPassword"
|
||||||
|
app:layout_constraintWidth_percent=".8" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/edtPasswordVerify"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:backgroundTint="#CCCCCC"
|
||||||
|
android:drawableLeft="@drawable/ic_baseline_vpn_key_24"
|
||||||
|
android:drawablePadding="13dp"
|
||||||
|
android:hint="Xác nhận mật khẩu"
|
||||||
|
android:fontFamily="@font/regular"
|
||||||
|
android:layout_margin="10dp"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#6DA3A3A3"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/edtPassword"
|
||||||
|
app:layout_constraintWidth_percent=".8" />
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/frameLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/edtPassword">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btnSave"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/btn_bg_design"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="Lưu lại"
|
||||||
|
android:textSize="13dp"
|
||||||
|
android:fontFamily="@font/bold"
|
||||||
|
android:textAllCaps="true"
|
||||||
|
android:layout_marginStart="40dp"
|
||||||
|
android:layout_marginEnd="40dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:indeterminateDrawable="@drawable/progress_bg"
|
||||||
|
android:visibility="gone" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
android:fontFamily="@font/regular"
|
android:fontFamily="@font/regular"
|
||||||
android:inputType="phone"
|
android:inputType="phone"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="#6DA3A3A3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtSignUp"
|
app:layout_constraintTop_toBottomOf="@+id/txtSignUp"
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
android:fontFamily="@font/regular"
|
android:fontFamily="@font/regular"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="#6DA3A3A3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/edtPhone"
|
app:layout_constraintTop_toBottomOf="@+id/edtPhone"
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
android:hint="Họ và tên"
|
android:hint="Họ và tên"
|
||||||
android:fontFamily="@font/regular"
|
android:fontFamily="@font/regular"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="#6DA3A3A3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtSignUp"
|
app:layout_constraintTop_toBottomOf="@+id/txtSignUp"
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
android:maxLength="10"
|
android:maxLength="10"
|
||||||
android:inputType="phone"
|
android:inputType="phone"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="#6DA3A3A3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txtFullName"
|
app:layout_constraintTop_toBottomOf="@+id/txtFullName"
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="#6DA3A3A3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/edtPhone"
|
app:layout_constraintTop_toBottomOf="@+id/edtPhone"
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
android:layout_margin="10dp"
|
android:layout_margin="10dp"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textColorHint="@color/white"
|
android:textColorHint="#6DA3A3A3"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/edtPassword"
|
app:layout_constraintTop_toBottomOf="@+id/edtPassword"
|
||||||
|
|||||||
@@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
<group android:checkableBehavior="single">
|
<group android:checkableBehavior="single">
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_home_address"
|
android:id="@+id/nav_information"
|
||||||
android:icon="@drawable/ic_baseline_home_24"
|
android:icon="@drawable/ic_baseline_account_circle_24"
|
||||||
android:iconTint="@color/white"
|
android:iconTint="@color/white"
|
||||||
android:title="Địa chỉ mặc định"
|
android:title="Thông tin cá nhân"
|
||||||
/>
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_favorites"
|
android:id="@+id/nav_favorites"
|
||||||
@@ -25,12 +25,6 @@
|
|||||||
android:icon="@drawable/ic_baseline_access_time_24"
|
android:icon="@drawable/ic_baseline_access_time_24"
|
||||||
android:title="Tình trạng đơn hàng" />
|
android:title="Tình trạng đơn hàng" />
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/nav_change_pwd"
|
|
||||||
android:icon="@drawable/ic_baseline_security_24"
|
|
||||||
android:title="Đổi mật khẩu"
|
|
||||||
android:iconTint="@color/white"
|
|
||||||
/>
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/nav_setting"
|
android:id="@+id/nav_setting"
|
||||||
android:icon="@drawable/ic_baseline_settings_24"
|
android:icon="@drawable/ic_baseline_settings_24"
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user