<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="vm"
            type="com.yidian.shenghuoquan.bgoods.ui.coupon.ChooseCategoryViewModel" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white"
        android:orientation="vertical">

        <include
            android:id="@+id/include"
            layout="@layout/layout_common_toolbar" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp40"
            android:layout_marginStart="@dimen/dp20"
            android:layout_marginTop="@dimen/dp10"
            android:layout_marginEnd="@dimen/dp20"
            android:layout_marginBottom="@dimen/dp10"
            android:background="@drawable/shape_gray_bg"
            android:gravity="center_vertical"
            android:onClick="@{() -> vm.gotoSearch()}"
            android:orientation="horizontal">

            <ImageView
                android:id="@+id/iv_search"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp10"
                android:src="@drawable/icon_search" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp5"
                android:text="请输入关键词搜索商品类目"
                android:textColor="@color/color_C2C2C2"
                android:textSize="@dimen/sp16" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp60"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingStart="@dimen/dp20"
            android:paddingEnd="@dimen/dp20">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableEnd="@drawable/icon_next_arrow"
                android:drawablePadding="@dimen/dp10"
                android:onClick="@{() -> vm.showFirstLevelList()}"
                android:text="@{vm.selectFirstCategoryName}"
                android:textColor="@color/color_333333"
                android:textSize="@dimen/sp16"
                app:isShow="@{vm.showSelectFirstCategory}" />

            <androidx.constraintlayout.widget.ConstraintLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:drawablePadding="@dimen/dp10"
                    android:text="请选择"
                    android:textColor="@color/color_1852F1"
                    android:textSize="@dimen/sp16"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <View
                    android:layout_width="@dimen/dp20"
                    android:layout_height="@dimen/dp2"
                    android:background="@color/color_1852F1"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>

        </LinearLayout>

        <View style="@style/cut_off_line_style" />

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_category_list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layoutAnimation="@null"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            tools:itemCount="3"
            tools:listitem="@layout/commodity_layout_category_list_item" />

    </LinearLayout>

</layout>