Add basket fragment

This commit is contained in:
Nezumi
2023-03-04 15:07:47 +07:00
parent a9b0ea500b
commit f4e9913c0c
23 changed files with 592 additions and 74 deletions
+1 -1
View File
@@ -95,7 +95,7 @@
android:layout_marginEnd="20dp"
android:fontFamily="@font/opensans"
android:text="@string/forgot_password"
android:textColor="@color/graylight"
android:textColor="@color/grayLight"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
+80 -6
View File
@@ -1,14 +1,88 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Fragment.BasketFragment">
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Fragment.BasketFragment"
android:id="@+id/list_basket_food_view"
>
<!-- TODO: Update blank fragment layout -->
<TextView
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="@string/hello_blank_fragment" />
android:orientation="vertical"
>
</FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_basket_food"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:listitem="@layout/item_food_basket"
/>
</LinearLayout>
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_alignParentBottom="true"
app:cardBackgroundColor="@color/green"
android:layout_width="match_parent"
android:layout_height="100dp"
app:layout_constraintTop_toBottomOf="@id/linearLayout"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<LinearLayout
android:layout_margin="8dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<TextView
android:text="Tổng cộng: "
android:textSize="20sp"
android:fontFamily="@font/opensans"
android:textColor="@android:color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/total"
android:text="$10,000"
android:fontFamily="@font/opensans"
android:textSize="24sp"
android:textColor="@android:color/white"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<Button
android:id="@+id/btnPlaceOrder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginStart="8dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:layout_marginBottom="8dp"
android:text="Đặt hàng"
android:fontFamily="@font/bebas"
android:textColor="@android:color/white"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".Fragment.FavouriteFragment"
tools:context=".Fragment.FavoriteFragment"
android:id="@+id/list_favorite_food_view"
>
+3 -3
View File
@@ -272,7 +272,7 @@
<Button
android:id="@+id/sign_up_button"
android:backgroundTint="@color/graylight"
android:backgroundTint="@color/grayLight"
android:text="Sign Up"
android:textSize="18sp"
android:fontFamily="@font/bebas"
@@ -300,7 +300,7 @@
android:text="Foodify V1.0.0"
android:textSize="18sp"
android:fontFamily="@font/opensans"
android:textColor="@color/graylight"
android:textColor="@color/grayLight"
android:layout_marginTop="30dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -314,7 +314,7 @@
android:text="Foodify Coperation"
android:textSize="18sp"
android:fontFamily="@font/opensans"
android:textColor="@color/graylight"
android:textColor="@color/grayLight"
android:layout_marginTop="20dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+1 -1
View File
@@ -69,7 +69,7 @@
android:id="@+id/end_of_list_text"
android:text="End of list"
android:fontFamily="@font/opensans"
android:textColor="@color/graylight"
android:textColor="@color/grayLight"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/progress_bar"
app:layout_constraintStart_toStartOf="parent"
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/red"
android:layout_margin="10dp"
>
<TextView
android:textColor="@color/white"
android:fontFamily="@font/opensans"
android:text="@string/delete"
android:textSize="20sp"
android:textStyle="bold"
android:layout_toStartOf="@id/img_delete"
android:layout_centerVertical="true"
android:layout_marginEnd="5dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<ImageView
android:id="@+id/img_delete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/baseline_delete_24"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="10dp"
tools:ignore="ContentDescription" />
</RelativeLayout>
<!--Layout foreground-->
<LinearLayout
android:id="@+id/layout_foreground"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:background="@color/white"
android:layout_margin="5dp"
>
<ImageView
android:id="@+id/image_view"
android:layout_width="110dp"
android:layout_height="110dp"
android:src="@drawable/food"
android:scaleType="centerCrop"
app:riv_corner_radius="10dip"
tools:ignore="ContentDescription" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<TextView
android:id="@+id/food_name_text_view"
android:text="@string/food_name"
android:textSize="18sp"
android:textColor="@color/black"
android:fontFamily="@font/opensans"
android:layout_width="match_parent"
android:layout_height="47dp"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
app:layout_constraintStart_toEndOf="@id/image_view"
app:layout_constraintTop_toTopOf="parent"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_weight="0.6"
android:layout_marginStart="5dp"
>
<TextView
android:id="@+id/shop_name_text_view"
android:text="Shop Name"
android:textSize="16sp"
android:textColor="@color/secondary"
android:fontFamily="@font/opensans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
app:layout_constraintStart_toEndOf="@id/image_view"
app:layout_constraintTop_toBottomOf="@id/text_view_1"
/>
<TextView
android:id="@+id/price_text_view"
android:text="$5.00"
android:textSize="25sp"
android:textColor="@color/primaryColor"
android:fontFamily="@font/bebas"
android:layout_width="220dp"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
/>
</LinearLayout>
<com.cepheuen.elegantnumberbutton.view.ElegantNumberButton
android:id="@+id/quantity"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:backGroundColor="@color/white"
app:textColor="@color/primaryColor"
android:layout_gravity="center_vertical"
android:layout_weight="0.4"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</FrameLayout>