<?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="mineViewModel"
            type="com.datarecovery.master.module.mine.MineViewModel" />

        <import type="com.atmob.common.ui.SizeUtil" />

        <import type="com.atmob.user.AtmobUser" />

        <import type="com.datarecovery.master.data.consts.ChannelId" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#F8F8F8">

        <ImageView
            android:id="@+id/iv_mine_background"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:src="@drawable/bg_mine_background"
            app:layout_constraintDimensionRatio="1080:648"
            app:layout_constraintTop_toTopOf="parent" />

        <Space
            android:id="@+id/space_status_bar"
            android:layout_width="match_parent"
            android:layout_height="@{SizeUtil.getStatusBarHeight(), default=@dimen/app_status_bar_height}"
            app:layout_constraintTop_toTopOf="parent" />

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

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

                <Space
                    android:id="@+id/space1"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:50"
                    app:layout_constraintTop_toTopOf="parent" />

                <ImageView
                    android:id="@+id/iv_account_avatar"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginStart="12dp"
                    android:src="@drawable/icon_logged_avatar"
                    app:layout_constraintDimensionRatio="1:1"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/space1"
                    app:layout_constraintWidth_percent="0.1333333333333333"
                    tools:src="@drawable/icon_not_login_avatar" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="12dp"
                    android:text='@{"游客" + mineViewModel.userId}'
                    android:textColor="@color/common_txt_color"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toBottomOf="@+id/iv_account_avatar"
                    app:layout_constraintStart_toEndOf="@+id/iv_account_avatar"
                    app:layout_constraintTop_toTopOf="@+id/iv_account_avatar" />

                <Space
                    android:id="@+id/space2"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:27"
                    app:layout_constraintTop_toBottomOf="@+id/iv_account_avatar" />

                <ImageView
                    android:id="@+id/iv_mine_member"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
                    android:onClick="@{()-> mineViewModel.onMemberClick()}"
                    android:src="@drawable/bg_mine_member"
                    app:layout_constraintDimensionRatio="984:234"
                    app:layout_constraintTop_toBottomOf="@+id/space2" />

                <TextView
                    android:id="@+id/iv_mine_member_title"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/app_name"
                    android:textColor="#6C4618"
                    android:textSize="18sp"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toTopOf="@+id/tv_mine_member_tips"
                    app:layout_constraintEnd_toEndOf="@+id/iv_mine_member"
                    app:layout_constraintHorizontal_bias="0.0843373493975904"
                    app:layout_constraintStart_toStartOf="@+id/iv_mine_member"
                    app:layout_constraintTop_toTopOf="@+id/iv_mine_member"
                    app:layout_constraintVertical_chainStyle="packed" />

                <TextView
                    android:id="@+id/tv_mine_member_tips"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="3dp"
                    android:letterSpacing="0.09"
                    android:lineSpacingMultiplier="2"
                    android:text="@string/mine_member_tips"
                    android:textColor="#B46B36"
                    android:textSize="11dp"
                    app:layout_constraintBottom_toBottomOf="@id/iv_mine_member"
                    app:layout_constraintStart_toStartOf="@+id/iv_mine_member_title"
                    app:layout_constraintTop_toBottomOf="@+id/iv_mine_member_title" />

                <TextView
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:background="@drawable/bg_mine_restore_now"
                    android:gravity="center"
                    android:text="@string/mine_restore_now"
                    android:textColor="#FFF9EC"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toBottomOf="@id/iv_mine_member"
                    app:layout_constraintDimensionRatio="82:28"
                    app:layout_constraintEnd_toEndOf="@+id/iv_mine_member"
                    app:layout_constraintHorizontal_bias="0.9549180327868852"
                    app:layout_constraintStart_toStartOf="@id/iv_mine_member"
                    app:layout_constraintTop_toTopOf="@+id/iv_mine_member"
                    app:layout_constraintWidth_percent="0.2277777777777778" />

                <Space
                    android:id="@+id/space3"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:14"
                    app:layout_constraintTop_toBottomOf="@+id/iv_mine_member" />

                <LinearLayout
                    android:id="@+id/ll_mine_settings"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
                    android:background="@drawable/bg_mine_container"
                    android:orientation="vertical"
                    android:paddingVertical="6dp"
                    app:layout_constraintTop_toBottomOf="@+id/space3">

                    <include
                        layout="@layout/layout_item_settings"
                        settingsIcon="@{@drawable/icon_small_about}"
                        settingsName="@{@string/mine_about}"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:onClick="@{()->mineViewModel.onAboutClick()}" />

                    <include
                        layout="@layout/layout_item_settings"
                        settingsIcon="@{@drawable/icon_small_suggestion}"
                        settingsName="@{@string/mine_suggestion}"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:onClick="@{()->mineViewModel.onFeedbackClick()}" />

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/ad_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:orientation="vertical"
                    app:layout_constraintTop_toBottomOf="@+id/ll_mine_settings" />

            </androidx.constraintlayout.widget.ConstraintLayout>

        </androidx.core.widget.NestedScrollView>

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