<?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="isWechatSelected"
            type="androidx.lifecycle.LiveData&lt;Boolean>" />

        <variable
            name="onWechatClickListener"
            type="android.view.View.OnClickListener" />

        <variable
            name="onQQClickListener"
            type="android.view.View.OnClickListener" />

        <variable
            name="onBtnClickListener"
            type="android.view.View.OnClickListener" />

        <import type="android.graphics.Color" />
    </data>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:background="@color/black70">

        <ScrollView
            android:id="@+id/scroll_view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent">

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

                <ImageView
                    android:id="@+id/backup_helper_image"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:src="@{isWechatSelected ? @drawable/bg_wechat_backup_helper : @drawable/bg_qq_backup_helper}"
                    app:layout_constraintTop_toTopOf="parent" />
            </androidx.constraintlayout.widget.ConstraintLayout>
        </ScrollView>

        <FrameLayout
            android:id="@+id/top_space"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:16"
            app:layout_constraintTop_toTopOf="parent" />

        <View
            android:id="@+id/top_view"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_backup_helper_tab"
            app:layout_constraintDimensionRatio="245:38"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintRight_toRightOf="parent"
            app:layout_constraintTop_toBottomOf="@id/top_space"
            app:layout_constraintWidth_percent="0.6805555555555556" />

        <View
            android:id="@+id/wechat_tutorial"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_wechat_tutorial"
            android:onClickListener="@{onWechatClickListener}"
            app:layout_constraintBottom_toBottomOf="@id/top_view"
            app:layout_constraintLeft_toLeftOf="@id/top_view"
            app:layout_constraintRight_toLeftOf="@id/qq_tutorial"
            app:layout_constraintTop_toTopOf="@id/top_view"
            app:selected='@{isWechatSelected}' />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawablePadding="4dp"
            android:gravity="center"
            android:text="微信教程"
            android:textColor='@{isWechatSelected ? Color.parseColor("#2C5524") : Color.parseColor("#CC717A8A")}'
            android:textSize="14sp"
            android:textStyle="bold"
            app:drawableStartCompat="@drawable/icon_wechat"
            app:layout_constraintBottom_toBottomOf="@id/wechat_tutorial"
            app:layout_constraintLeft_toLeftOf="@id/wechat_tutorial"
            app:layout_constraintRight_toRightOf="@id/wechat_tutorial"
            app:layout_constraintTop_toTopOf="@id/wechat_tutorial" />

        <View
            android:id="@+id/qq_tutorial"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_qq_tutorial"
            android:onClickListener="@{onQQClickListener}"
            app:layout_constraintBottom_toBottomOf="@id/top_view"
            app:layout_constraintLeft_toRightOf="@id/wechat_tutorial"
            app:layout_constraintRight_toRightOf="@id/top_view"
            app:layout_constraintTop_toTopOf="@id/top_view"
            app:selected='@{!isWechatSelected}' />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:drawablePadding="4dp"
            android:gravity="center"
            android:text="QQ教程"
            android:textColor='@{!isWechatSelected ? Color.parseColor("#184B76") : Color.parseColor("#CC717A8A")}'
            android:textSize="14sp"
            android:textStyle="bold"
            app:drawableStartCompat="@drawable/icon_qq"
            app:layout_constraintBottom_toBottomOf="@id/qq_tutorial"
            app:layout_constraintLeft_toLeftOf="@id/qq_tutorial"
            app:layout_constraintRight_toRightOf="@id/qq_tutorial"
            app:layout_constraintTop_toTopOf="@id/qq_tutorial" />

        <View
            android:id="@+id/bottom_view"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@color/white"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintDimensionRatio="360:74" />

        <TextView
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:background="@drawable/bg_backup_helper_button"
            android:gravity="center"
            android:text="我知道了"
            android:textColor="@color/white"
            android:onClickListener="@{onBtnClickListener}"
            android:textSize="14sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@id/bottom_view"
            app:layout_constraintDimensionRatio="330:46"
            app:layout_constraintLeft_toLeftOf="@id/bottom_view"
            app:layout_constraintRight_toRightOf="@id/bottom_view"
            app:layout_constraintTop_toTopOf="@id/bottom_view"
            app:layout_constraintWidth_percent="0.9166666666666667" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</layout>