Files
Foodify/app/src/main/res/layout/fragment_search.xml
T

116 lines
4.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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.SearchFragment"
android:id="@+id/search_fragment"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/search_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<androidx.cardview.widget.CardView
android:id="@+id/card_view"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="5dp"
app:cardElevation="5dp"
android:layout_marginBottom="5dp"
>
<androidx.appcompat.widget.SearchView
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:queryBackground="@android:color/transparent"
app:queryHint="Search here..."
android:background="@color/white"
app:iconifiedByDefault="false"
/>
</androidx.cardview.widget.CardView>
<com.google.android.material.chip.ChipGroup
android:id="@+id/list_category"
app:layout_constraintTop_toBottomOf="@+id/card_view"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_search"
tools:listitem="@layout/item_food_search"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/list_category"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
/>
<LinearLayout
android:id="@+id/search_not_found"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/list_category"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
android:orientation="vertical"
android:visibility="gone"
>
<ImageView
android:layout_width="150dp"
android:layout_height="150dp"
android:src="@drawable/dish"
android:layout_marginTop="100dp"
android:layout_gravity="center_horizontal"
/>
<TextView
android:text="Không có kết quả cần tìm. Vui lòng tìm thử với từ khoá khác."
android:fontFamily="@font/opensans"
android:textColor="@color/gray"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:textAlignment="center"
/>
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar"
android:indeterminateTint="@color/primaryColor"
app:layout_constraintTop_toBottomOf="@id/recycler_view_search"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/end_of_list_text"
android:text="End of list"
android:fontFamily="@font/opensans"
android:textColor="@color/grayLight"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/progress_bar"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>