<?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="homePageViewModel"
            type="com.datarecovery.master.module.homepage.HomePageViewModel" />

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

    </data>

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

        <androidx.core.widget.NestedScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#F6F7F6"
            app:layout_constraintBottom_toBottomOf="parent">

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

                <ImageView
                    android:id="@+id/iv_banner"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:adjustViewBounds="true"
                    android:onClick="@{()-> homePageViewModel.onBannerClick()}"
                    android:src="@drawable/bg_home_banner"
                    app:layout_constraintTop_toTopOf="parent" />

                <TextView
                    android:id="@+id/tv_recover_btn"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:background="@drawable/bg_home_recover_btn"
                    android:gravity="center"
                    app:layout_constraintBottom_toBottomOf="@id/iv_banner"
                    app:layout_constraintDimensionRatio="110:35.5"
                    app:layout_constraintHorizontal_bias="0.129"
                    app:layout_constraintLeft_toLeftOf="@id/iv_banner"
                    app:layout_constraintRight_toRightOf="@id/iv_banner"
                    app:layout_constraintTop_toTopOf="@id/iv_banner"
                    app:layout_constraintVertical_bias="0.72"
                    app:layout_constraintWidth_percent="0.3055555555555556" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:drawablePadding="3dp"
                    android:text="免费解锁"
                    android:textColor="#1F49EB"
                    android:textSize="12sp"
                    android:textStyle="bold"
                    app:drawableStartCompat="@drawable/icon_home_recover_btn"
                    app:layout_constraintBottom_toBottomOf="@id/tv_recover_btn"
                    app:layout_constraintLeft_toLeftOf="@id/tv_recover_btn"
                    app:layout_constraintRight_toRightOf="@id/tv_recover_btn"
                    app:layout_constraintTop_toTopOf="@id/tv_recover_btn" />

                <ImageView
                    android:id="@+id/home_tab_indicator"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="-21dp"
                    android:adjustViewBounds="true"
                    android:src="@drawable/selector_home_page_tab_indicator"
                    app:Selected="@{homePageViewModel.isQQSelected}"
                    app:layout_constraintTop_toBottomOf="@id/iv_banner" />

                <View
                    android:id="@+id/wechat_click_area"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:onClick="@{()-> homePageViewModel.onWeChatAreaClick()}"
                    app:layout_constraintBottom_toBottomOf="@id/home_tab_indicator"
                    app:layout_constraintLeft_toLeftOf="@id/home_tab_indicator"
                    app:layout_constraintRight_toLeftOf="@id/qq_click_area"
                    app:layout_constraintTop_toTopOf="@id/home_tab_indicator" />

                <View
                    android:id="@+id/qq_click_area"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:onClick="@{()-> homePageViewModel.onQQAreaClick()}"
                    app:layout_constraintBottom_toBottomOf="@id/home_tab_indicator"
                    app:layout_constraintLeft_toRightOf="@id/wechat_click_area"
                    app:layout_constraintRight_toRightOf="@id/home_tab_indicator"
                    app:layout_constraintTop_toTopOf="@id/home_tab_indicator" />

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

                <View
                    android:id="@+id/v_information_bg"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
                    android:background="@drawable/bg_home_page_scroll"
                    app:layout_constraintDimensionRatio="328:32"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/space3" />

                <TextView
                    android:id="@+id/tv_information"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginStart="8dp"
                    android:background="@drawable/selector_home_page_information"
                    android:gravity="center"
                    android:text="@string/home_page_information"
                    android:textColor="@color/white"
                    android:textSize="12dp"
                    app:Selected="@{homePageViewModel.isQQSelected}"
                    app:layout_constraintBottom_toBottomOf="@+id/v_information_bg"
                    app:layout_constraintDimensionRatio="32:16"
                    app:layout_constraintStart_toStartOf="@+id/v_information_bg"
                    app:layout_constraintTop_toTopOf="@+id/v_information_bg"
                    app:layout_constraintWidth_percent="0.0888888888888889" />

                <ViewSwitcher
                    android:id="@+id/view_switcher"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="8dp"
                    app:layout_constraintBottom_toBottomOf="@+id/v_information_bg"
                    app:layout_constraintLeft_toRightOf="@+id/tv_information"
                    app:layout_constraintRight_toRightOf="@+id/v_information_bg"
                    app:layout_constraintTop_toTopOf="@+id/v_information_bg" />

                <Space
                    android:id="@+id/space5"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:16"
                    app:layout_constraintTop_toBottomOf="@+id/v_information_bg" />

                <View
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:background="@drawable/selector_icon_hot_function_light"
                    app:Selected="@{homePageViewModel.isQQSelected}"
                    app:layout_constraintBottom_toBottomOf="@id/tv_hot_function"
                    app:layout_constraintDimensionRatio="1:1"
                    app:layout_constraintLeft_toRightOf="@id/tv_hot_function"
                    app:layout_constraintRight_toRightOf="@id/tv_hot_function"
                    app:layout_constraintWidth_percent="0.0361111111111111" />

                <TextView
                    android:id="@+id/tv_hot_function"
                    style="@style/Home_Page_Title_Text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
                    android:text="@string/home_page_hot_function"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/space5" />

                <Space
                    android:id="@+id/space6"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:12"
                    app:layout_constraintTop_toBottomOf="@+id/tv_hot_function" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/ry_other_function"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
                    android:overScrollMode="never"
                    android:scrollbars="none"
                    app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                    app:layout_constraintTop_toBottomOf="@+id/space6"
                    app:spanCount="2"
                    tools:itemCount="6"
                    tools:listitem="@layout/item_home_page_other_function" />

                <Space
                    android:id="@+id/space9"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:20"
                    app:layout_constraintTop_toBottomOf="@+id/ry_other_function" />

            </androidx.constraintlayout.widget.ConstraintLayout>
        </androidx.core.widget.NestedScrollView>

        <ImageView
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
            android:adjustViewBounds="true"
            android:onClick="@{()-> homePageViewModel.onBackupHelperClick()}"
            android:src="@drawable/icon_backup_helper_enter"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="0.958"
            app:layout_constraintWidth_percent="0.375" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>