<?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="userData"
            type="com.rdiot.yx485.bean.UserData" />

        <variable
            name="familyData"
            type="com.rdiot.yx485.bean.FamilyData" />
    </data>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_horizontal"
        android:orientation="vertical"
        tools:context=".ui.mine.MineFragment">

        <com.rdiot.yx485.view.ZNavbar
            android:id="@+id/nb"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:zTitle="@string/mine" />

        <androidx.core.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fillViewport="true"
            android:overScrollMode="never">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:id="@+id/ll_user_info"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_horizontal"
                    android:orientation="vertical">

                    <androidx.appcompat.widget.AppCompatImageView
                        android:id="@+id/iv_avatar"
                        android:layout_width="100dp"
                        android:layout_height="100dp"
                        android:adjustViewBounds="true"
                        app:layout_constraintBottom_toBottomOf="@id/tv_1"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintTop_toTopOf="@id/tv_user_name"
                        tools:srcCompat="@mipmap/icon_default_user_big" />

                    <TextView
                        android:maxLines="1"
                        android:maxLength="16"
                        android:ellipsize="end"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="16dp"
                        android:text="@{userData.userName}"
                        android:textColor="@color/main_text_color"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        tools:text="mR.2hao" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@{@string/account(userData.phone)}"
                        android:textColor="@color/main_sub_text_color"
                        android:textSize="14sp"
                        tools:text="账号：18688888888" />


                </LinearLayout>


                <LinearLayout
                    android:id="@+id/ll_home"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="20dp"
                    android:layout_marginTop="16dp"
                    android:layout_marginEnd="20dp"
                    android:background="@drawable/bg_my_home_banner"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:paddingTop="30dp"
                    android:paddingBottom="20dp">

                    <androidx.appcompat.widget.AppCompatImageView
                        android:layout_width="25dp"
                        android:layout_height="25dp"
                        android:layout_marginStart="18dp"
                        app:srcCompat="@mipmap/icon_home_2" />

                    <TextView
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="12dp"
                        android:layout_weight="1"
                        android:ellipsize="end"
                        android:maxLines="1"
                        android:text="@{familyData.name}"
                        android:textColor="@color/white"
                        android:textSize="18sp"
                        android:textStyle="bold"
                        tools:text="@string/my_home" />

                    <androidx.appcompat.widget.AppCompatImageView
                        android:layout_width="20dp"
                        android:layout_height="20dp"
                        android:layout_marginEnd="18dp"
                        app:srcCompat="@mipmap/icon_enter" />
                </LinearLayout>

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_weight="1"
                    android:background="@color/white">
                    <!--房间管理-->
                    <LinearLayout
                        android:id="@+id/ll_home_management"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="20dp"
                        android:layout_marginTop="50dp"
                        android:layout_marginEnd="10dp"
                        android:background="@drawable/bg_mine_option"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:padding="20dp"
                        app:layout_constraintEnd_toStartOf="@id/ll_setting"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent">

                        <androidx.appcompat.widget.AppCompatImageView
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            app:srcCompat="@mipmap/icon_administration" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:text="@string/family_management"
                            android:textColor="@color/main_text_color"
                            android:textSize="14sp"
                            android:textStyle="bold" />

                    </LinearLayout>

                    <!--我的场景-->
                    <LinearLayout
                        android:id="@+id/ll_setting"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="20dp"
                        android:background="@drawable/bg_mine_option"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:padding="20dp"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toEndOf="@+id/ll_home_management"
                        app:layout_constraintTop_toTopOf="@id/ll_home_management">

                        <androidx.appcompat.widget.AppCompatImageView
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            app:srcCompat="@mipmap/icon_set" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:text="@string/system_settings"
                            android:textColor="@color/main_text_color"
                            android:textSize="14sp"
                            android:textStyle="bold" />

                    </LinearLayout>

                    <!--帮助与反馈-->
                    <LinearLayout
                        android:id="@+id/ll_help"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="20dp"
                        android:background="@drawable/bg_mine_option"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:padding="20dp"
                        app:layout_constraintEnd_toEndOf="@id/ll_home_management"
                        app:layout_constraintStart_toStartOf="@id/ll_home_management"
                        app:layout_constraintTop_toBottomOf="@id/ll_home_management">

                        <androidx.appcompat.widget.AppCompatImageView
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            app:srcCompat="@mipmap/icon_help" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:text="@string/help_and_feedback"
                            android:textColor="@color/main_text_color"
                            android:textSize="14sp"
                            android:textStyle="bold" />

                    </LinearLayout>

                    <!--我的场景-->
                    <LinearLayout
                        android:visibility="gone"
                        android:id="@+id/ll_setting2"
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="20dp"
                        android:background="@drawable/bg_mine_option"
                        android:gravity="center"
                        android:orientation="vertical"
                        android:padding="20dp"
                        app:layout_constraintEnd_toEndOf="@id/ll_setting"
                        app:layout_constraintStart_toStartOf="@id/ll_setting"
                        app:layout_constraintTop_toBottomOf="@id/ll_setting">

                        <androidx.appcompat.widget.AppCompatImageView
                            android:layout_width="40dp"
                            android:layout_height="40dp"
                            app:srcCompat="@mipmap/icon_set" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="5dp"
                            android:text="@string/system_settings"
                            android:textColor="@color/main_text_color"
                            android:textSize="14sp"
                            android:textStyle="bold" />

                    </LinearLayout>


                </androidx.constraintlayout.widget.ConstraintLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="@color/white"
                    android:gravity="center_horizontal|bottom"
                    android:orientation="horizontal"
                    android:paddingTop="20dp"
                    android:paddingBottom="10dp"
                    app:layout_constraintBottom_toBottomOf="parent">

                    <TextView
                        android:id="@+id/tv_sa"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/user_services_agreement"
                        android:textColor="@color/login_btn_color"
                        android:textSize="13sp" />

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="|"
                        android:textColor="@color/dividing_line_color"
                        android:textSize="13sp" />

                    <TextView
                        android:id="@+id/tv_pp"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/privacy_policy"
                        android:textColor="@color/login_btn_color"
                        android:textSize="13sp" />
                </LinearLayout>


            </LinearLayout>

        </androidx.core.widget.NestedScrollView>


    </LinearLayout>
</layout>