Init data from API to screen, fix some UI

This commit is contained in:
Nezumi
2023-02-20 13:04:14 +07:00
parent d24c061e1f
commit 6d5682be6d
10 changed files with 306 additions and 64 deletions
@@ -62,7 +62,7 @@
<LinearLayout
android:id="@+id/linear_layout"
android:id="@+id/linear_layout_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
@@ -117,7 +117,7 @@
android:fontFamily="@font/opensans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/linear_layout"
app:layout_constraintTop_toBottomOf="@id/linear_layout_1"
app:layout_constraintStart_toStartOf="parent"
/>
@@ -155,6 +155,7 @@
>
<LinearLayout
android:id="@+id/linear_layout_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
@@ -190,7 +191,8 @@
>
<TextView
android:text="Total"
android:id="@+id/total_text_view"
android:text="Price"
android:fontFamily="@font/bebas"
android:textColor="@color/black"
android:textSize="15sp"
@@ -200,6 +202,7 @@
/>
<TextView
android:id="@+id/price"
android:text="25.000 VND"
android:fontFamily="@font/bebas"
android:textColor="@color/primaryColor"
@@ -228,6 +231,7 @@
/>
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="2dp"
android:background="#c0c0c0"
@@ -273,9 +277,15 @@
app:layout_constraintStart_toStartOf="parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|center_vertical"
android:visibility="gone"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
+25 -19
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="130dp"
android:layout_width="120dp"
android:layout_height="221dp"
android:layout_marginBottom="10dp"
android:layout_marginEnd="10dp"
@@ -18,8 +18,8 @@
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/image_view"
android:layout_width="131dp"
android:layout_height="131dp"
android:layout_width="120dp"
android:layout_height="120dp"
android:src="@drawable/food"
android:scaleType="centerCrop"
app:riv_corner_radius="10dip"
@@ -31,7 +31,7 @@
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="34dp"
android:layout_height="40dp"
android:text="@string/food_title"
android:layout_marginStart="3dp"
android:layout_marginEnd="3dp"
@@ -57,32 +57,38 @@
<TextView
android:id="@+id/price"
android:textSize="18sp"
android:text="100.000"
android:text="1000000000"
android:textColor="@color/primaryColor"
android:fontFamily="@font/bebas"
android:layout_marginStart="6dp"
android:layout_width="0dp"
android:layout_weight="0.55"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
<TextView
android:text="-59%"
android:textSize="8sp"
android:textColor="@color/red"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0.2"
/>
<ImageView
android:id="@+id/basket_icon"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginEnd="5dp"
android:layout_weight="0.18"
android:layout_marginTop="3dp"
android:contentDescription="@string/basket_icon"
android:src="@drawable/basket_icon" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginTop="2dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/basket_icon"
android:layout_width="20dp"
android:layout_height="match_parent"
android:layout_marginEnd="4dp"
android:layout_marginTop="10dp"
android:contentDescription="@string/basket_icon"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/basket_icon"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>