<?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="settingViewModel"
            type="com.atmob.voiceai.module.setting.SettingViewModel" />
    </data>

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

        <ImageView
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:src="@drawable/bg_setting_activity_background"
            app:layout_constraintDimensionRatio="1080:2400"
            app:layout_constraintTop_toTopOf="parent" />

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintTop_toTopOf="parent"
            app:navigationIcon="@drawable/icon_setting_back">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="@string/voice_setting"
                android:textColor="@color/white"
                android:textSize="17sp"
                android:textStyle="bold" />
        </androidx.appcompat.widget.Toolbar>

        <Space
            android:id="@+id/space1"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            app:layout_constraintDimensionRatio="360:39"
            app:layout_constraintTop_toBottomOf="@id/toolbar" />

        <ImageView
            android:id="@+id/iv_setting_logo"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:src="@drawable/icon_setting_logo"
            app:layout_constraintDimensionRatio="148:88"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/space1"
            app:layout_constraintWidth_percent="0.4111111111111111" />

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

        <View
            android:id="@+id/view_setting_pro"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginHorizontal="24dp"
            android:background="@drawable/bg_setting_pro"
            android:onClick="@{()-> settingViewModel.onSettingProClick()}"
            app:layout_constraintDimensionRatio="312:60"
            app:layout_constraintTop_toBottomOf="@id/space2" />

        <TextView
            tools:text="Funny Voice AI Pro"
            android:text="@{settingViewModel.proName}"
            android:id="@+id/tv_setting_pro"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:textColor="@color/colorPrimary"
            android:textSize="17sp"
            android:textStyle="bold"
            app:layout_constraintBottom_toBottomOf="@+id/view_setting_pro"
            app:layout_constraintStart_toStartOf="@+id/view_setting_pro"
            app:layout_constraintTop_toTopOf="@+id/view_setting_pro" />

        <ImageView
            android:id="@+id/iv_setting_pro_arrow"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:layout_marginEnd="20dp"
            android:src="@drawable/icon_setting_pro_arrow"
            app:layout_constraintBottom_toBottomOf="@+id/view_setting_pro"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintEnd_toEndOf="@+id/view_setting_pro"
            app:layout_constraintTop_toTopOf="@+id/view_setting_pro"
            app:layout_constraintWidth_percent="0.1" />

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

        <androidx.constraintlayout.widget.Group
            isGone="@{settingViewModel.isMember}"
            app:constraint_referenced_ids="view_setting_pro,tv_setting_pro,iv_setting_pro_arrow"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_constraintTop_toBottomOf="@+id/space3">

            <include
                isGone="@{settingViewModel.isHideScoring}"
                layout="@layout/layout_item_settings"
                settingsIcon="@{@drawable/icon_setting_rate}"
                settingsName="@{@string/setting_rate_app}"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:onClick="@{()->settingViewModel.onRateClick()}" />

            <include
                layout="@layout/layout_item_settings"
                settingsIcon="@{@drawable/icon_setting_email}"
                settingsName="@{@string/setting_contact}"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:onClick="@{()->settingViewModel.onSendEmailClick()}" />

            <include
                layout="@layout/layout_item_settings"
                settingsIcon="@{@drawable/icon_setting_privacy_policy}"
                settingsName="@{@string/setting_privacy_policy}"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:onClick="@{()->settingViewModel.onPrivacyPolicyClick()}" />

            <include
                layout="@layout/layout_item_settings"
                settingsIcon="@{@drawable/icon_setting_terms_of_service}"
                settingsName="@{@string/setting_terms_of_service}"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:onClick="@{()->settingViewModel.onTermsOfServiceClick()}" />
        </LinearLayout>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="24dp"
            android:text="@{settingViewModel.versionName}"
            android:textColor="@color/white80"
            android:textSize="17sp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            tools:text="version1.0" />

        <View
            android:id="@+id/v_event"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            android:layout_width="60dp"
            android:layout_height="60dp" />


        <View
            android:id="@+id/v_attr"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintBottom_toBottomOf="parent"
            android:layout_width="60dp"
            android:layout_height="60dp" />


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