mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 20:00:50 +00:00
Improve layout
This commit is contained in:
@@ -72,7 +72,7 @@ import vn.zalopay.sdk.listeners.PayOrderListener;
|
||||
|
||||
public class OrderCheckOutActivity extends AppCompatActivity {
|
||||
private static final String TAKE_FOOD_FROM_SHOP = "Đến shop lấy";
|
||||
private static final String ZALO_PAYMENT_METHOD = "ZALO PAY";
|
||||
private static final String ZALO_PAYMENT_METHOD = "Zalo Pay";
|
||||
private static final String CASH_PAYMENT = "CASH";
|
||||
private static Double LAT_SHOP = 0.0;
|
||||
private static Double LNG_SHOP = 0.0;
|
||||
|
||||
@@ -216,7 +216,7 @@ public class SignUpActivity extends AppCompatActivity {
|
||||
signUp(user);
|
||||
} else {
|
||||
loadCompleted();
|
||||
Toast.makeText(SignUpActivity.this, "Email or Phone exist!", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(SignUpActivity.this, "Địa chỉ email hoặc số điện thoại đã trùng, vui lòng kiểm tra lại!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -250,6 +250,7 @@ public class VerifyAccountActivity extends AppCompatActivity {
|
||||
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();
|
||||
FirebaseAuth.getInstance().signOut();
|
||||
startActivity(new Intent(VerifyAccountActivity.this, SignInActivity.class));
|
||||
finish();
|
||||
} else {
|
||||
|
||||
@@ -57,14 +57,7 @@ public class FoodAdapter extends RecyclerView.Adapter<FoodAdapter.FoodViewHolder
|
||||
return;
|
||||
}
|
||||
|
||||
String foodName = food.getName();
|
||||
if(foodName.length() >= 24){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getName());
|
||||
stringBuilder.replace(24, food.getName().length(), "..." );
|
||||
holder.name.setText(stringBuilder);
|
||||
} else {
|
||||
holder.name.setText(foodName);
|
||||
}
|
||||
holder.name.setText(food.getName());
|
||||
|
||||
//When food does not have image
|
||||
if(food.getImages().size() == 0){
|
||||
|
||||
@@ -56,25 +56,9 @@ public class FoodSearchAdapter extends RecyclerView.Adapter<FoodSearchAdapter.Fo
|
||||
}
|
||||
|
||||
//Init data
|
||||
String foodName = food.getName();
|
||||
if(foodName.length() >= LENGTH_CHARACTER){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getName());
|
||||
stringBuilder.replace(LENGTH_CHARACTER, food.getName().length(), "..." );
|
||||
holder.name.setText(stringBuilder);
|
||||
} else {
|
||||
holder.name.setText(foodName);
|
||||
}
|
||||
|
||||
String shopName = food.getShop().getName();
|
||||
|
||||
if(shopName.length() >= 18){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getShop().getName());
|
||||
stringBuilder.replace(18, food.getShop().getName().length(), "..." );
|
||||
holder.shopName.setText(stringBuilder);
|
||||
} else {
|
||||
holder.shopName.setText(shopName);
|
||||
}
|
||||
|
||||
holder.name.setText(food.getName());
|
||||
holder.shopName.setText(food.getShop().getName());
|
||||
|
||||
//When food does not have image
|
||||
if(food.getImages().size() == 0){
|
||||
|
||||
@@ -61,23 +61,9 @@ public class FoodShopAdapter extends RecyclerView.Adapter<FoodShopAdapter.FoodSh
|
||||
}
|
||||
holder.price.setText(Common.changeCurrencyUnit(food.getCost()));
|
||||
|
||||
String foodName = food.getName();
|
||||
if(foodName.length() >= MAX_CHARACTER){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getName());
|
||||
stringBuilder.replace(MAX_CHARACTER, food.getName().length(), "..." );
|
||||
holder.foodName.setText(stringBuilder);
|
||||
} else {
|
||||
holder.foodName.setText(foodName);
|
||||
}
|
||||
holder.foodName.setText(food.getName());
|
||||
|
||||
String description = food.getDescription();
|
||||
if(description.length() >= MAX_CHARACTER){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getDescription());
|
||||
stringBuilder.replace(MAX_CHARACTER, food.getDescription().length(), "..." );
|
||||
holder.description.setText(stringBuilder);
|
||||
} else {
|
||||
holder.description.setText(description);
|
||||
}
|
||||
holder.description.setText(food.getDescription());
|
||||
|
||||
//Check value discountPercent
|
||||
float cost;
|
||||
|
||||
@@ -46,26 +46,9 @@ public class OrderDetailAdapter extends RecyclerView.Adapter<OrderDetailAdapter.
|
||||
holder.shop_name.setText(food.getShopName());
|
||||
holder.quantity.setText("Số lượng: " + food.getQuantity());
|
||||
|
||||
String foodName = food.getName();
|
||||
if(foodName.length() >= 35){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getName());
|
||||
stringBuilder.replace(35, food.getName().length(), "..." );
|
||||
holder.food_name.setText(stringBuilder);
|
||||
} else {
|
||||
holder.food_name.setText(foodName);
|
||||
}
|
||||
|
||||
String shopName = food.getShopName();
|
||||
|
||||
if(shopName.length() >= 18){
|
||||
StringBuilder stringBuilder = new StringBuilder(food.getShopName());
|
||||
stringBuilder.replace(18, food.getShopName().length(), "..." );
|
||||
holder.shop_name.setText(stringBuilder);
|
||||
} else {
|
||||
holder.shop_name.setText(shopName);
|
||||
}
|
||||
|
||||
holder.food_name.setText(food.getName());
|
||||
|
||||
holder.shop_name.setText(food.getShopName());
|
||||
|
||||
//Check value discountPercent
|
||||
float cost = 0;
|
||||
|
||||
@@ -50,15 +50,7 @@ public class ShopAdapter extends RecyclerView.Adapter<ShopAdapter.ShopViewHolder
|
||||
//Init data
|
||||
Picasso.get().load(shop.getImageUrl()).into(holder.imageView);
|
||||
|
||||
String shopName = shop.getName();
|
||||
|
||||
if(shopName.length() >= 24){
|
||||
StringBuilder stringBuilder = new StringBuilder(shop.getName());
|
||||
stringBuilder.replace(24, shop.getName().length(), "..." );
|
||||
holder.shopName.setText(stringBuilder);
|
||||
} else {
|
||||
holder.shopName.setText(shopName);
|
||||
}
|
||||
holder.shopName.setText(shop.getName());
|
||||
|
||||
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user