mirror of
https://github.com/Nezumi-2711/Foodify.git
synced 2026-09-22 13:38:41 +00:00
Improve layout
This commit is contained in:
@@ -72,7 +72,7 @@ import vn.zalopay.sdk.listeners.PayOrderListener;
|
|||||||
|
|
||||||
public class OrderCheckOutActivity extends AppCompatActivity {
|
public class OrderCheckOutActivity extends AppCompatActivity {
|
||||||
private static final String TAKE_FOOD_FROM_SHOP = "Đến shop lấy";
|
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 final String CASH_PAYMENT = "CASH";
|
||||||
private static Double LAT_SHOP = 0.0;
|
private static Double LAT_SHOP = 0.0;
|
||||||
private static Double LNG_SHOP = 0.0;
|
private static Double LNG_SHOP = 0.0;
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ public class SignUpActivity extends AppCompatActivity {
|
|||||||
signUp(user);
|
signUp(user);
|
||||||
} else {
|
} else {
|
||||||
loadCompleted();
|
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);
|
progressLayout.setVisibility(View.GONE);
|
||||||
//Create user success;
|
//Create user success;
|
||||||
Toast.makeText(VerifyAccountActivity.this, "Tạo tài khoản thành công!", Toast.LENGTH_SHORT).show();
|
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));
|
startActivity(new Intent(VerifyAccountActivity.this, SignInActivity.class));
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -57,14 +57,7 @@ public class FoodAdapter extends RecyclerView.Adapter<FoodAdapter.FoodViewHolder
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
String foodName = food.getName();
|
holder.name.setText(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);
|
|
||||||
}
|
|
||||||
|
|
||||||
//When food does not have image
|
//When food does not have image
|
||||||
if(food.getImages().size() == 0){
|
if(food.getImages().size() == 0){
|
||||||
|
|||||||
@@ -56,25 +56,9 @@ public class FoodSearchAdapter extends RecyclerView.Adapter<FoodSearchAdapter.Fo
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Init data
|
//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
|
//When food does not have image
|
||||||
if(food.getImages().size() == 0){
|
if(food.getImages().size() == 0){
|
||||||
|
|||||||
@@ -61,23 +61,9 @@ public class FoodShopAdapter extends RecyclerView.Adapter<FoodShopAdapter.FoodSh
|
|||||||
}
|
}
|
||||||
holder.price.setText(Common.changeCurrencyUnit(food.getCost()));
|
holder.price.setText(Common.changeCurrencyUnit(food.getCost()));
|
||||||
|
|
||||||
String foodName = food.getName();
|
holder.foodName.setText(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);
|
|
||||||
}
|
|
||||||
|
|
||||||
String description = food.getDescription();
|
holder.description.setText(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);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Check value discountPercent
|
//Check value discountPercent
|
||||||
float cost;
|
float cost;
|
||||||
|
|||||||
@@ -46,26 +46,9 @@ public class OrderDetailAdapter extends RecyclerView.Adapter<OrderDetailAdapter.
|
|||||||
holder.shop_name.setText(food.getShopName());
|
holder.shop_name.setText(food.getShopName());
|
||||||
holder.quantity.setText("Số lượng: " + food.getQuantity());
|
holder.quantity.setText("Số lượng: " + food.getQuantity());
|
||||||
|
|
||||||
String foodName = food.getName();
|
holder.food_name.setText(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.shop_name.setText(food.getShopName());
|
||||||
|
|
||||||
//Check value discountPercent
|
//Check value discountPercent
|
||||||
float cost = 0;
|
float cost = 0;
|
||||||
|
|||||||
@@ -50,15 +50,7 @@ public class ShopAdapter extends RecyclerView.Adapter<ShopAdapter.ShopViewHolder
|
|||||||
//Init data
|
//Init data
|
||||||
Picasso.get().load(shop.getImageUrl()).into(holder.imageView);
|
Picasso.get().load(shop.getImageUrl()).into(holder.imageView);
|
||||||
|
|
||||||
String shopName = shop.getName();
|
holder.shopName.setText(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.itemView.setOnClickListener(new View.OnClickListener() {
|
holder.itemView.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -78,6 +78,8 @@
|
|||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -105,6 +107,8 @@
|
|||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -76,6 +76,8 @@
|
|||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -90,6 +92,8 @@
|
|||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -43,6 +43,8 @@
|
|||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -63,6 +65,8 @@
|
|||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -78,6 +78,8 @@
|
|||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -96,7 +98,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/description"
|
android:id="@+id/description"
|
||||||
android:text="Descriptionssssssssssssssssssssssssssss"
|
android:text="Description"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@color/gray"
|
android:textColor="@color/gray"
|
||||||
android:fontFamily="@font/opensans"
|
android:fontFamily="@font/opensans"
|
||||||
@@ -105,6 +107,8 @@
|
|||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -43,6 +43,8 @@
|
|||||||
android:layout_weight="0.4"
|
android:layout_weight="0.4"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -71,6 +73,8 @@
|
|||||||
android:layout_marginTop="2dp"
|
android:layout_marginTop="2dp"
|
||||||
app:layout_constraintStart_toEndOf="@id/image_view"
|
app:layout_constraintStart_toEndOf="@id/image_view"
|
||||||
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
app:layout_constraintTop_toBottomOf="@id/text_view_1"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -41,6 +41,8 @@
|
|||||||
android:layout_marginTop="3dp"
|
android:layout_marginTop="3dp"
|
||||||
app:layout_constraintTop_toBottomOf="@id/imageView"
|
app:layout_constraintTop_toBottomOf="@id/imageView"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:ellipsize="end"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user