<?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="model"
            type="com.lukouguoji.module_base.model.NoticeMessageDialogModel" />
    </data>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:layout_width="350dp"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginTop="10dp"
            android:background="@drawable/bg_white_radius_8"
            android:orientation="vertical"
            android:padding="10dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_vertical"
                android:onClick="@{()->model.foldClick()}">

                <ImageView
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:src="@drawable/img_message_svg"
                    app:tint="@color/colorPrimary" />

                <View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_weight="1" />

                <TextView
                    shape_bg_color='@{"#dad8d8"}'
                    shape_radius="@{11}"
                    android:layout_width="wrap_content"
                    android:layout_height="22dp"
                    android:background="#dad8d8"
                    android:gravity="center_vertical"
                    android:paddingHorizontal="15dp"
                    android:text="@{model.count}"
                    tools:text="1" />

                <ImageView
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:layout_marginLeft="10dp"
                    android:padding="@dimen/dp_4"
                    android:src="@drawable/img_sp_down" />

            </LinearLayout>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rv"
                visible="@{!model.folded}"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="10dp"
                app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
                tools:itemCount="2"
                tools:listitem="@layout/item_notice_message" />

            <TextView
                visible="@{!model.folded}"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="end"
                android:layout_marginTop="10dp"
                android:onClick="@{()-> model.dismiss()}"
                android:text="全部清除"
                android:textColor="@color/colorPrimary" />

        </LinearLayout>


    </RelativeLayout>

</layout>