<?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.quansu.heifengwuliu.vmodel.MineVModel" />
    </data >

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

        <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
            android:id="@+id/refresh_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent" >

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

                <RelativeLayout
                    android:id="@+id/lay_title"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/title_bar_height"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent" >

                    <TextView
                        android:id="@+id/tv_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_centerInParent="true"
                        android:layout_marginTop="20dp"
                        android:text="个人中心"
                        android:textColor="@color/text_title"
                        android:textSize="@dimen/sp_16"
                        android:textStyle="bold" />

                    <ImageView
                        android:layout_width="25dp"
                        android:layout_height="25dp"
                        android:layout_alignParentEnd="true"
                        android:layout_centerVertical="true"
                        android:layout_marginEnd="@dimen/dp_10"
                        android:onClick="@{v->vm.goMsg()}"
                        android:padding="@dimen/dp_2"
                        android:src="@drawable/ic_msg" />

                </RelativeLayout >

                <androidx.constraintlayout.widget.ConstraintLayout
                    android:id="@+id/lay_user_info"
                    android:layout_width="match_parent"
                    android:layout_height="106dp"
                    android:paddingStart="@dimen/dp_10"
                    android:paddingEnd="@dimen/dp_10"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/lay_title" >

                    <com.qmuiteam.qmui.widget.QMUIRadiusImageView
                        android:id="@+id/img_user_avater"
                        android:layout_width="55dp"
                        android:layout_height="55dp"
                        android:src="@drawable/ic_default_image"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent"
                        app:qmui_is_circle="true"
                        app:url="@{vm.user.avatar()}" />

                    <TextView
                        android:id="@+id/tv_user_name"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="@dimen/dp_10"
                        android:layout_marginTop="10dp"
                        android:text="@{vm.user.name}"
                        app:layout_constraintStart_toEndOf="@id/img_user_avater"
                        app:layout_constraintTop_toTopOf="@id/img_user_avater"
                        tools:text="郑货主" />

                    <TextView
                        android:id="@+id/tv_user_mobile"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginStart="@dimen/dp_10"
                        android:layout_marginBottom="10dp"
                        android:text="@{vm.user.mobile}"
                        app:layout_constraintBottom_toBottomOf="@id/img_user_avater"
                        app:layout_constraintStart_toEndOf="@id/img_user_avater"
                        tools:text="18353965350" />

                    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
                        android:id="@+id/btn_identity_unverified"
                        android:layout_width="80dp"
                        android:layout_height="26dp"
                        android:layout_marginEnd="@dimen/dp_10"
                        android:onClick="@{v->vm.goPersonalVerify()}"
                        android:text="@string/identity_unverified"
                        android:textColor="#459AEA"
                        android:textSize="@dimen/sp_13"
                        app:layout_constraintBottom_toTopOf="@id/btn_com_unverified"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintTop_toTopOf="@id/img_user_avater"
                        app:qmui_backgroundColor="#E8F1FB"
                        app:qmui_borderColor="#459AEA"
                        app:qmui_radius="@dimen/dp_4" />

                    <com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
                        android:id="@+id/btn_com_unverified"
                        android:layout_width="80dp"
                        android:layout_height="26dp"
                        android:layout_marginTop="@dimen/dp_8"
                        android:layout_marginEnd="@dimen/dp_10"
                        android:onClick="@{v->vm.user.isDriver()?vm.goVehicleVerify():vm.goComVerify()}"
                        android:text="@{vm.user.isDriver()?@string/vehicle_unverified:@string/com_unverified}"
                        android:textColor="#459AEA"
                        android:textSize="@dimen/sp_13"
                        app:layout_constraintBottom_toBottomOf="@id/img_user_avater"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintTop_toBottomOf="@id/btn_identity_unverified"
                        app:qmui_backgroundColor="#E8F1FB"
                        app:qmui_borderColor="#459AEA"
                        app:qmui_radius="@dimen/dp_4" />

                </androidx.constraintlayout.widget.ConstraintLayout >

                <com.qmuiteam.qmui.layout.QMUILinearLayout
                    android:id="@+id/ll_center"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:layout_marginTop="@dimen/dp_20"
                    android:layout_marginEnd="10dp"
                    android:background="@color/white"
                    android:orientation="horizontal"
                    android:paddingTop="15dp"
                    android:paddingBottom="20dp"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/lay_user_info" >

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:onClick="@{v->vm.goMyAccount()}"
                        android:orientation="vertical" >

                        <ImageView
                            style="@style/img_mine"
                            android:src="@drawable/ic_default_image" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="@string/my_account" />

                    </LinearLayout >

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:onClick="@{v->vm.goCollection()}"

                        android:orientation="vertical" >

                        <ImageView
                            style="@style/img_mine"
                            android:src="@drawable/ic_default_image" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="@string/my_collection" />

                    </LinearLayout >

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <ImageView
                            style="@style/img_mine"
                            android:src="@drawable/ic_default_image" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="@string/invoice_manage" />

                    </LinearLayout >

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center"
                        android:orientation="vertical" >

                        <ImageView
                            style="@style/img_mine"
                            android:src="@drawable/ic_default_image" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_marginTop="6dp"
                            android:text="@string/connect_service" />

                    </LinearLayout >

                </com.qmuiteam.qmui.layout.QMUILinearLayout >

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:orientation="vertical"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@id/ll_center" >

                    <LinearLayout
                        style="@style/mine_list"
                        android:layout_marginTop="4dp" >

                        <ImageView
                            style="@style/mine_img"
                            android:src="@drawable/ic_cloud_sync" />

                        <TextView
                            style="@style/mine_text"
                            android:text="我的评价" />

                        <ImageView
                            style="@style/mine_arrow_right"
                            android:src="@drawable/mine_right" />

                    </LinearLayout >

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

                    <LinearLayout style="@style/mine_list" >

                        <ImageView
                            style="@style/mine_img"
                            android:src="@drawable/ic_backup" />

                        <TextView
                            style="@style/mine_text"
                            android:text="地址薄" />

                        <ImageView
                            style="@style/mine_arrow_right"
                            android:src="@drawable/mine_right" />

                    </LinearLayout >

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

                    <LinearLayout
                        android:id="@+id/lay_settings"
                        style="@style/mine_list"
                        android:onClick="@{v->vm.goSettings()}" >

                        <ImageView
                            style="@style/mine_img"
                            android:src="@drawable/ic_private_settings" />

                        <TextView
                            style="@style/mine_text"
                            android:text="设置" />

                        <ImageView
                            style="@style/mine_arrow_right"
                            android:src="@drawable/mine_right" />

                    </LinearLayout >

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

                </LinearLayout >

                <TextView
                    style="@style/mine_text"
                    android:layout_gravity="center"
                    android:layout_marginBottom="@dimen/dp_40"
                    android:onClick="@{v->vm.callPhone()}"
                    android:text="平台联系方式：1835397689"
                    android:textColor="@color/qmui_config_color_gray_5"
                    app:layout_constraintBottom_toBottomOf="parent"
                    app:layout_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent" />

            </androidx.constraintlayout.widget.ConstraintLayout >
        </androidx.swiperefreshlayout.widget.SwipeRefreshLayout >
    </LinearLayout >
</layout >
