<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <com.example.base.widget.TitleBar
        android:id="@+id/mTitleBar"
        style="@style/Custom.TitleBar"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:navigationIcon="@drawable/ic_back_black"
        app:title=" " />

    <FrameLayout
        android:id="@+id/layout_search"
        android:layout_width="match_parent"
        android:layout_height="?actionBarSize"
        android:layout_marginStart="@dimen/dp_50"
        android:layout_marginEnd="@dimen/dp_16"
        app:layout_constraintBottom_toBottomOf="@id/mTitleBar">

        <androidx.appcompat.widget.LinearLayoutCompat
            android:layout_width="match_parent"
            android:layout_height="@dimen/dp_36"
            android:layout_gravity="center_vertical"
            android:background="@drawable/shape_white_cor10"
            android:gravity="center_vertical"
            android:orientation="horizontal"
            android:paddingStart="@dimen/dp_12"
            android:paddingEnd="@dimen/dp_12">

            <TextView
                android:id="@+id/tv_city"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:drawableEnd="@mipmap/ic_option_arrow_down"
                android:drawablePadding="@dimen/dp_4"
                android:gravity="center"
                android:text="地区"
                android:textColor="@color/color_1a1a1a"
                android:textSize="@dimen/sp_14" />

            <View
                android:layout_width="@dimen/dp_1"
                android:layout_height="@dimen/dp_24"
                android:layout_marginStart="@dimen/dp_12"
                android:background="@color/color_eeeeee" />

            <androidx.appcompat.widget.AppCompatEditText
                android:id="@+id/et_search"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_10"
                android:layout_weight="1"
                android:background="@null"
                android:drawableStart="@mipmap/ic_search"
                android:drawablePadding="@dimen/dp_11"
                android:hint="输入关键词"
                android:maxLines="1"
                android:singleLine="true"
                android:textColor="@color/color_1a1a1a"
                android:textColorHint="@color/color_bcbcbc"
                android:textSize="@dimen/sp_14" />

            <androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/iv_clear_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_10"
                android:src="@mipmap/ic_clear_text"
                android:visibility="gone" />
        </androidx.appcompat.widget.LinearLayoutCompat>
    </FrameLayout>

    <androidx.core.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@id/mTitleBar">

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

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/layout_selected"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="gone"
                app:layout_constraintTop_toTopOf="parent">

                <TextView
                    android:id="@+id/tv_selected_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/dp_16"
                    android:layout_marginTop="@dimen/dp_16"
                    android:drawableStart="@mipmap/ic_selected_source_tag"
                    android:drawablePadding="@dimen/dp_4"
                    android:gravity="center"
                    android:text="已选择数据源"
                    android:textColor="@color/color_1a1a1a"
                    android:textSize="@dimen/sp_16"
                    android:textStyle="bold"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/tv_selected_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/dp_4"
                    android:text="(0/5)"
                    android:textColor="@color/color_1a1a1a"
                    android:textSize="@dimen/sp_14"
                    app:layout_constraintBottom_toBottomOf="@id/tv_selected_title"
                    app:layout_constraintStart_toEndOf="@id/tv_selected_title"
                    app:layout_constraintTop_toTopOf="@id/tv_selected_title" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_selected"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/dp_9"
                    android:layout_marginTop="@dimen/dp_1"
                    android:layout_marginEnd="@dimen/dp_9"
                    android:orientation="horizontal"
                    android:overScrollMode="never"
                    app:layoutManager="com.google.android.flexbox.FlexboxLayoutManager"
                    app:layout_constraintTop_toBottomOf="@id/tv_selected_title"
                    tools:listitem="@layout/listitem_selected_source" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <TextView
                android:id="@+id/tv_recommend_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_16"
                android:layout_marginTop="@dimen/dp_16"
                android:drawableStart="@mipmap/ic_recommend_fire"
                android:drawablePadding="@dimen/dp_4"
                android:gravity="center"
                android:text="热门推荐"
                android:textColor="@color/color_1a1a1a"
                android:textSize="@dimen/sp_16"
                android:textStyle="bold"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/layout_selected" />

            <com.lihang.ShadowLayout
                android:id="@+id/layout_recommend"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/dp_9"
                android:layout_marginTop="@dimen/dp_5"
                android:layout_marginEnd="@dimen/dp_9"
                app:hl_cornerRadius="@dimen/dp_10"
                app:hl_shadowColor="@color/color_shadow"
                app:hl_shadowLimit="@dimen/dp_7"
                app:layout_constraintTop_toBottomOf="@id/tv_recommend_title">

                <androidx.appcompat.widget.AppCompatImageView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:scaleType="centerCrop"
                    android:src="@mipmap/ic_recommend_source_top_bg" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/rv_recommend"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:overScrollMode="never"
                    app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                    tools:itemCount="10"
                    tools:listitem="@layout/listitem_recommend_source" />

            </com.lihang.ShadowLayout>

            <Space
                android:layout_width="match_parent"
                android:layout_height="@dimen/dp_15"
                app:layout_constraintTop_toBottomOf="@id/layout_recommend" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </androidx.core.widget.NestedScrollView>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/layout_result"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#cc000000"
        android:clickable="true"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@id/mTitleBar">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_result"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/shape_white_bottom_cor10"
            android:overScrollMode="never"
            android:paddingTop="@dimen/dp_8"
            android:paddingBottom="@dimen/dp_8"
            app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
            app:layout_constraintTop_toTopOf="parent"
            tools:listitem="@layout/listitem_search_source_result" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.constraintlayout.widget.ConstraintLayout>