<?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"
        android:background="@color/white">


        <View
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@drawable/bg_home_page"
            app:layout_constraintDimensionRatio="360:280"
            app:layout_constraintTop_toTopOf="parent"
            tools:layout_editor_absoluteX="102dp"
            tools:layout_editor_absoluteY="113dp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@drawable/bg_home_page_radial"
            app:layout_constraintDimensionRatio="360:280"
            app:layout_constraintStart_toStartOf="parent"
            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"
            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:16"
                    app:layout_constraintTop_toTopOf="parent" />

                <ImageView
                    android:id="@+id/iv_logo"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
                    android:src="@drawable/icon_home_page_logo"
                    app:layout_constraintDimensionRatio="246:60"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/space1"
                    app:layout_constraintWidth_percent="0.2277777777777778" />

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

                <ImageView
                    android:id="@+id/iv_banner"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_marginHorizontal="@dimen/app_common_page_horizontal_padding"
                    android:src="@drawable/icon_home_page_banner"
                    app:layout_constraintDimensionRatio="984:360"
                    app:layout_constraintTop_toBottomOf="@+id/space2" />

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

                <View
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:background="@drawable/bg_home_page_content"
                    app:layout_constraintBottom_toBottomOf="@+id/space9"
                    app:layout_constraintTop_toBottomOf="@+id/space3" />

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

                <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_constraintEnd_toEndOf="parent"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/space4" />

                <TextView
                    android:id="@+id/tv_information"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginStart="8dp"
                    android:background="@drawable/bg_home_page_information"
                    android:gravity="center"
                    android:text="@string/home_page_information"
                    android:textColor="@color/white"
                    android:textSize="12dp"
                    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_constraintEnd_toEndOf="@+id/v_information_bg"
                    app:layout_constraintStart_toEndOf="@+id/tv_information"
                    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" />

                <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" />

                <View
                    android:id="@+id/v_wx_message_recovery"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginStart="@dimen/app_common_page_horizontal_padding"
                    android:background="@drawable/bg_wx_message_recovery"
                    android:onClick="@{()-> homePageViewModel.onWxMessageRecoveryClick()}"
                    app:layout_constraintDimensionRatio="152:108"
                    app:layout_constraintHorizontal_chainStyle="spread_inside"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintRight_toLeftOf="@+id/v_wx_friend_recovery"
                    app:layout_constraintTop_toBottomOf="@+id/space6"
                    app:layout_constraintWidth_percent="0.4222222222222222" />


                <ImageView
                    android:id="@+id/iv_wx_message_recovery"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:src="@drawable/icon_home_page_message_recovery"
                    app:layout_constraintBottom_toBottomOf="@+id/v_wx_message_recovery"
                    app:layout_constraintDimensionRatio="1:1"
                    app:layout_constraintEnd_toEndOf="@+id/v_wx_message_recovery"
                    app:layout_constraintHorizontal_bias="0.1388888888888889"
                    app:layout_constraintStart_toStartOf="@+id/v_wx_message_recovery"
                    app:layout_constraintTop_toTopOf="@+id/v_wx_message_recovery"
                    app:layout_constraintVertical_bias="0.21875"
                    app:layout_constraintWidth_percent="0.1222222222222222" />

                <TextView
                    android:id="@+id/tv_wx_message_recovery"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/home_page_wx_msg_recovery"
                    android:textColor="@color/white"
                    android:textSize="15dp"
                    android:textStyle="bold"
                    app:layout_constraintStart_toStartOf="@+id/iv_wx_message_recovery"
                    app:layout_constraintTop_toBottomOf="@+id/iv_wx_message_recovery" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/home_page_wx_msg_recovery_desc"
                    android:textColor="@color/white"
                    android:textSize="10dp"
                    app:layout_constraintStart_toStartOf="@+id/tv_wx_message_recovery"
                    app:layout_constraintTop_toBottomOf="@+id/tv_wx_message_recovery" />


                <View
                    android:id="@+id/v_wx_friend_recovery"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:layout_marginEnd="@dimen/app_common_page_horizontal_padding"
                    android:background="@drawable/bg_wx_friend_recovery"
                    android:onClick="@{()-> homePageViewModel.onWxFriendRecoveryClick()}"
                    app:layout_constraintDimensionRatio="168:50"
                    app:layout_constraintLeft_toRightOf="@+id/v_wx_message_recovery"
                    app:layout_constraintRight_toRightOf="parent"
                    app:layout_constraintTop_toTopOf="@+id/v_wx_message_recovery"
                    app:layout_constraintWidth_percent="0.4666666666666667" />

                <ImageView
                    android:id="@+id/iv_wx_friend_recovery"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:src="@drawable/icon_home_page_friend_recovery"
                    app:layout_constraintBottom_toBottomOf="@+id/v_wx_friend_recovery"
                    app:layout_constraintDimensionRatio="111:114"
                    app:layout_constraintEnd_toEndOf="@+id/v_wx_friend_recovery"
                    app:layout_constraintHorizontal_bias="0.0757575757575758"
                    app:layout_constraintStart_toStartOf="@+id/v_wx_friend_recovery"
                    app:layout_constraintTop_toTopOf="@+id/v_wx_friend_recovery"
                    app:layout_constraintWidth_percent="0.1" />

                <TextView
                    android:id="@+id/tv_wx_friend_recovery"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:text="@string/home_page_wx_friend_recovery"
                    android:textColor="@color/white"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toTopOf="@+id/tv_wx_friend_recovery_desc"
                    app:layout_constraintStart_toEndOf="@+id/iv_wx_friend_recovery"
                    app:layout_constraintTop_toTopOf="@+id/iv_wx_friend_recovery"
                    app:layout_constraintVertical_chainStyle="packed" />

                <TextView
                    android:id="@+id/tv_wx_friend_recovery_desc"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/home_page_wx_friend_recovery_desc"
                    android:textColor="@color/white"
                    android:textSize="10sp"
                    app:layout_constraintBottom_toBottomOf="@+id/iv_wx_friend_recovery"
                    app:layout_constraintStart_toStartOf="@+id/tv_wx_friend_recovery"
                    app:layout_constraintTop_toBottomOf="@+id/tv_wx_friend_recovery" />

                <View
                    android:id="@+id/v_img_recovery"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:background="@drawable/bg_img_recovery"
                    android:onClick="@{()-> homePageViewModel.onImgRecoveryClick()}"
                    app:layout_constraintBottom_toBottomOf="@id/v_wx_message_recovery"
                    app:layout_constraintDimensionRatio="168:50"
                    app:layout_constraintEnd_toEndOf="@+id/v_wx_friend_recovery"
                    app:layout_constraintLeft_toRightOf="@+id/v_wx_message_recovery"
                    app:layout_constraintWidth_percent="0.4666666666666667" />

                <TextView
                    isGone="@{!homePageViewModel.isOpenTrialMembership || !homePageViewModel.isShowImageTrialTag}"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:background="@drawable/bg_trial_tag"
                    android:paddingHorizontal="9dp"
                    android:paddingVertical="2dp"
                    android:text="@string/trial"
                    android:textColor="@color/white"
                    android:textSize="10dp"
                    app:layout_constraintEnd_toEndOf="@+id/v_img_recovery"
                    app:layout_constraintTop_toTopOf="@+id/v_img_recovery" />

                <ImageView
                    android:id="@+id/iv_img_recovery"
                    android:layout_width="0dp"
                    android:layout_height="0dp"
                    android:src="@drawable/icon_home_page_img_recovery"
                    app:layout_constraintBottom_toBottomOf="@+id/v_img_recovery"
                    app:layout_constraintDimensionRatio="111:114"
                    app:layout_constraintEnd_toEndOf="@+id/v_img_recovery"
                    app:layout_constraintHorizontal_bias="0.0757575757575758"
                    app:layout_constraintStart_toStartOf="@+id/v_img_recovery"
                    app:layout_constraintTop_toTopOf="@+id/v_img_recovery"
                    app:layout_constraintWidth_percent="0.1" />

                <TextView
                    android:id="@+id/tv_img_recovery"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="8dp"
                    android:text="@string/home_page_img_recovery"
                    android:textColor="@color/white"
                    android:textSize="14sp"
                    android:textStyle="bold"
                    app:layout_constraintBottom_toTopOf="@+id/tv_img_recovery_desc"
                    app:layout_constraintStart_toEndOf="@+id/iv_img_recovery"
                    app:layout_constraintTop_toTopOf="@+id/iv_img_recovery"
                    app:layout_constraintVertical_chainStyle="packed" />

                <TextView
                    android:id="@+id/tv_img_recovery_desc"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/home_page_img_recovery_desc"
                    android:textColor="@color/white"
                    android:textSize="10sp"
                    app:layout_constraintBottom_toBottomOf="@+id/iv_img_recovery"
                    app:layout_constraintStart_toStartOf="@+id/tv_img_recovery"
                    app:layout_constraintTop_toBottomOf="@+id/tv_img_recovery" />

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


                <TextView
                    android:id="@+id/tv_other_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_other_function"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/space7" />

                <Space
                    android:id="@+id/space8"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    app:layout_constraintDimensionRatio="360:6"
                    app:layout_constraintTop_toBottomOf="@+id/tv_other_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/space8"
                    app:spanCount="4"
                    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>


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