<?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="familyData"
            type="com.rdiot.yx485.bean.FamilyData" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/cl_item"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="20dp"
        android:layout_marginTop="20dp"
        android:layout_marginEnd="20dp"
        android:background="@drawable/bg_mine_option"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:paddingTop="30dp"
        android:paddingBottom="20dp">


        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/iv"
            android:layout_width="25dp"
            android:layout_height="25dp"
            android:layout_marginStart="18dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@mipmap/icon_home_2" />


        <TextView
            android:id="@+id/tv_family_name"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="12dp"
            android:ellipsize="end"
            android:maxLines="1"
            android:text="@{familyData.name}"
            android:textColor="@color/main_text_color"
            android:textSize="18sp"
            android:textStyle="bold"
            app:layout_constraintEnd_toStartOf="@+id/textView2"
            app:layout_constraintStart_toEndOf="@id/iv"
            app:layout_constraintTop_toTopOf="parent"
            tools:text="@string/my_home" />

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/iv_online_status"
            srcString="@{familyData.online?`icon_dot_online`:`icon_dot_offline`}"
            android:layout_width="8dp"
            android:layout_height="8dp"
            app:layout_constraintBottom_toBottomOf="@id/tv_online_status"
            app:layout_constraintStart_toStartOf="@id/tv_family_name"
            app:layout_constraintTop_toTopOf="@id/tv_online_status"
            app:srcCompat="@mipmap/icon_dot_online" />

        <TextView
            android:id="@+id/tv_online_status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="5dp"
            android:text="@{familyData.online?@string/online:@string/offline}"
            android:textColor="@color/main_text_color"
            android:textSize="12sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintStart_toEndOf="@id/iv_online_status"
            app:layout_constraintTop_toBottomOf="@id/tv_family_name"
            tools:text="@string/online" />

        <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{@string/family_member_num(familyData.member.size)}"
            android:textColor="@color/main_text_color"
            android:textSize="12sp"
            app:layout_constraintBottom_toBottomOf="@id/iv_arrow"
            app:layout_constraintEnd_toStartOf="@id/iv_arrow"
            app:layout_constraintTop_toTopOf="@id/iv_arrow"
            tools:text="@string/family_member_num" />


        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/iv_arrow"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_marginEnd="18dp"
            android:rotation="180"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@mipmap/icon_back" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>