<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/activity_background"
    android:clickable="true"
    android:focusable="true"
    tools:context=".screen.setting.SettingFragment">

    <View
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:visibility="gone"
        android:background="@drawable/app_background" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/bottom_guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.90" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/left_guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.05" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/right_guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.95" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/middle_guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.50" />

    <LinearLayout
        android:id="@+id/lay_title"
        android:layout_width="0dp"
        android:layout_height="48dp"
        android:background="@drawable/bg_box_title"
        android:orientation="horizontal"
        android:layout_marginTop="16dp"
        app:layout_constraintEnd_toStartOf="@+id/right_guideline"
        app:layout_constraintStart_toStartOf="@+id/left_guideline"
        app:layout_constraintTop_toTopOf="parent">

        <View
            android:layout_width="8dp"
            android:layout_height="match_parent"
            android:background="@drawable/bg_box_highlight" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center_vertical"
            android:paddingStart="8dp"
            android:paddingEnd="8dp"
            android:textSize="18sp"
            android:text="Setting"
            android:textColor="@android:color/white"
            android:textStyle="bold" />
    </LinearLayout>

    <View
        android:id="@+id/v_bg"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:background="@color/blue_grey"
        app:layout_constraintBottom_toTopOf="@id/bottom_guideline"
        app:layout_constraintEnd_toEndOf="@+id/right_guideline"
        app:layout_constraintStart_toStartOf="@+id/left_guideline"
        app:layout_constraintTop_toBottomOf="@+id/lay_title" />
    <!--    <ImageView-->
    <!--        android:layout_width="wrap_content"-->
    <!--        android:layout_height="18dp"-->
    <!--        android:layout_marginStart="38dp"-->
    <!--        android:layout_marginTop="8dp"-->
    <!--        android:id="@+id/iv_old_pwd"-->
    <!--        android:scaleType="fitXY"-->
    <!--        android:adjustViewBounds="true"-->
    <!--        android:src="@drawable/text_old_pwd"-->
    <!--        app:layout_constraintBottom_toTopOf="@+id/til_old_pwd"-->
    <!--        app:layout_constraintTop_toTopOf="@id/v_bg"-->
    <!--        app:layout_constraintStart_toStartOf="@+id/v_bg"-->
    <!--        app:tint="@color/color_black" />-->
    <!--    <com.google.android.material.textfield.TextInputLayout-->
    <!--        android:id="@+id/til_old_pwd"-->
    <!--        style="@style/GDTTextInputLayout.PasswordToggle"-->
    <!--        android:layout_width="0dp"-->
    <!--        android:layout_height="30dp"-->
    <!--        android:layout_marginTop="4dp"-->
    <!--        android:layout_marginStart="24dp"-->
    <!--        android:layout_marginEnd="24dp"-->
    <!--        app:hintEnabled="false"-->
    <!--        app:layout_constraintTop_toBottomOf="@id/iv_old_pwd"-->
    <!--        app:layout_constraintStart_toStartOf="@+id/v_bg"-->
    <!--        app:layout_constraintEnd_toEndOf="@+id/v_bg"-->
    <!--        app:startIconTint="@color/color_login_icon"-->
    <!--        app:boxCornerRadiusTopEnd="@dimen/login_edit_text_corner"-->
    <!--        app:boxCornerRadiusTopStart="@dimen/login_edit_text_corner"-->
    <!--        app:boxCornerRadiusBottomEnd="@dimen/login_edit_text_corner"-->
    <!--        app:boxCornerRadiusBottomStart="@dimen/login_edit_text_corner"-->
    <!--        app:startIconDrawable="@drawable/ic_lock">-->

    <!--        <androidx.appcompat.widget.AppCompatEditText-->
    <!--            android:id="@+id/et_old_pwd"-->
    <!--            android:layout_width="match_parent"-->
    <!--            android:layout_height="wrap_content"-->
    <!--            android:inputType="textPassword"-->
    <!--            android:padding="0dp"-->
    <!--            android:maxLength="50"-->
    <!--            android:textColor="@color/colorPrimary"-->
    <!--            android:textSize="12sp" />-->
    <!--    </com.google.android.material.textfield.TextInputLayout>-->

    <ImageView
        android:id="@+id/iv_new_pwd"
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        android:layout_marginStart="24dp"
        android:layout_marginTop="8dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/text_old_pwd"
        app:layout_constraintBottom_toTopOf="@+id/til_new_pwd"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toTopOf="@id/v_bg"
        app:tint="@color/color_white" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/til_new_pwd"
        style="@style/GDTTextInputLayout.PasswordToggle"
        android:layout_width="0dp"
        android:layout_height="38dp"
        android:layout_marginStart="24dp"
        android:layout_marginTop="4dp"
        android:layout_marginEnd="24dp"
        app:boxCornerRadiusBottomEnd="@dimen/login_edit_text_corner"
        app:boxCornerRadiusBottomStart="@dimen/login_edit_text_corner"
        app:boxCornerRadiusTopEnd="@dimen/login_edit_text_corner"
        app:boxCornerRadiusTopStart="@dimen/login_edit_text_corner"
        app:hintEnabled="false"
        app:layout_constraintEnd_toEndOf="@+id/v_bg"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/iv_new_pwd"
        app:startIconDrawable="@drawable/ic_lock"
        app:startIconTint="@color/color_white">

        <androidx.appcompat.widget.AppCompatEditText
            android:id="@+id/et_current_pwd"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPassword"
            android:maxLength="50"
            android:padding="0dp"
            android:textColor="@android:color/white"
            android:textSize="16sp" />
    </com.google.android.material.textfield.TextInputLayout>

    <ImageView
        android:id="@+id/iv_confirm_pwd"
        android:layout_width="wrap_content"
        android:layout_height="18dp"
        android:layout_marginStart="24dp"
        android:layout_marginTop="8dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/text_new_pwd"
        app:layout_constraintBottom_toTopOf="@+id/til_confirm_pwd"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/til_new_pwd"
        app:tint="@color/color_white" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/til_confirm_pwd"
        style="@style/GDTTextInputLayout.PasswordToggle"
        android:layout_width="0dp"
        android:layout_height="38dp"
        android:layout_marginStart="24dp"
        android:layout_marginTop="4dp"
        android:layout_marginEnd="24dp"
        app:boxCornerRadiusBottomEnd="@dimen/login_edit_text_corner"
        app:boxCornerRadiusBottomStart="@dimen/login_edit_text_corner"
        app:boxCornerRadiusTopEnd="@dimen/login_edit_text_corner"
        app:boxCornerRadiusTopStart="@dimen/login_edit_text_corner"
        app:hintEnabled="false"
        app:layout_constraintEnd_toEndOf="@+id/v_bg"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/iv_confirm_pwd"
        app:startIconDrawable="@drawable/ic_lock"
        app:startIconTint="@color/color_white">

        <androidx.appcompat.widget.AppCompatEditText
            android:id="@+id/et_new_pwd"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPassword"
            android:maxLength="50"
            android:textColorHint="@android:color/white"
            android:padding="0dp"
            android:textColor="@android:color/white"
            android:textSize="16sp" />
    </com.google.android.material.textfield.TextInputLayout>

    <com.sambath.klaklouk_main.view.SettingButtonView
        android:id="@+id/v_save"
        android:layout_width="150dp"
        android:layout_height="38dp"
        android:layout_marginTop="16dp"
        app:bgDrawable="@drawable/bg_btn_save"
        app:layout_constraintEnd_toEndOf="@+id/v_bg"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/til_confirm_pwd"
        app:textIcon="@drawable/text_save" />

    <TextView
        android:id="@+id/tv_error"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="8dp"
        android:gravity="center"
        android:text=""
        android:textColor="@color/color_red_800"
        android:visibility="visible"
        app:layout_constraintEnd_toEndOf="@+id/v_bg"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/v_save" />

    <View
        android:id="@+id/v_line1"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:layout_marginTop="4dp"
        android:background="@color/color_white"
        app:layout_constraintEnd_toEndOf="@+id/til_confirm_pwd"
        app:layout_constraintStart_toStartOf="@+id/til_confirm_pwd"
        app:layout_constraintTop_toBottomOf="@id/tv_error" />

    <ImageView
        android:id="@+id/iv_bluetooth"
        android:layout_width="wrap_content"
        android:layout_height="24dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="4dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/bluetooth_text"
        app:layout_constraintEnd_toStartOf="@+id/middle_guideline"
        app:layout_constraintTop_toBottomOf="@+id/v_line1"
        app:tint="@color/color_white" />

    <com.google.android.material.switchmaterial.SwitchMaterial
        android:id="@+id/sw_bluetooth"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_marginStart="4dp"
        android:checked="true"
        app:thumbTint="@color/thumb_selector"
        app:trackTint="@color/track_selector"
        app:layout_constraintBottom_toBottomOf="@+id/iv_bluetooth"
        app:layout_constraintStart_toEndOf="@+id/middle_guideline"
        app:layout_constraintTop_toTopOf="@+id/iv_bluetooth" />

    <ImageView
        android:id="@+id/iv_print"
        android:layout_width="wrap_content"
        android:layout_height="24dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="4dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/bluetooth_auto_print"
        app:layout_constraintEnd_toStartOf="@+id/middle_guideline"
        app:layout_constraintTop_toBottomOf="@+id/iv_bluetooth"
        app:tint="@color/color_white" />

    <com.google.android.material.switchmaterial.SwitchMaterial
        android:id="@+id/sw_print"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_marginStart="4dp"
        app:thumbTint="@color/thumb_selector"
        app:trackTint="@color/track_selector"
        app:layout_constraintBottom_toBottomOf="@+id/iv_print"
        app:layout_constraintStart_toEndOf="@+id/middle_guideline"
        app:layout_constraintTop_toTopOf="@+id/iv_print" />

    <ImageView
        android:id="@+id/iv_connect"
        android:layout_width="wrap_content"
        android:layout_height="24dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="4dp"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/bluetooth_connected"
        app:layout_constraintEnd_toStartOf="@+id/middle_guideline"
        app:layout_constraintTop_toBottomOf="@+id/iv_print"
        app:tint="@color/color_white" />

    <TextView
        android:id="@+id/text_connect"
        android:layout_width="50dp"
        android:layout_height="0dp"
        android:layout_marginStart="4dp"
        android:gravity="center_vertical"
        android:textColor="@color/color_white"
        app:layout_constraintBottom_toBottomOf="@+id/iv_connect"
        app:layout_constraintStart_toEndOf="@+id/middle_guideline"
        app:layout_constraintTop_toTopOf="@+id/iv_connect" />

    <com.sambath.klaklouk_main.view.SettingButtonView
        android:id="@+id/v_print"
        android:layout_width="150dp"
        android:layout_height="38dp"
        android:layout_marginTop="8dp"
        app:bgDrawable="@drawable/bg_btn_connect"
        app:layout_constraintEnd_toEndOf="@+id/v_bg"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/iv_connect"
        app:textIcon="@drawable/blue_text_connect" />

    <View
        android:id="@+id/v_line2"
        android:layout_width="0dp"
        android:layout_height="1dp"
        android:layout_marginTop="8dp"
        android:background="@color/color_white"
        app:layout_constraintEnd_toEndOf="@+id/til_confirm_pwd"
        app:layout_constraintStart_toStartOf="@+id/til_confirm_pwd"
        app:layout_constraintTop_toBottomOf="@id/v_print" />

    <com.sambath.klaklouk_main.view.SettingButtonView
        android:id="@+id/v_logout"
        android:layout_width="150dp"
        android:layout_height="38dp"
        android:layout_marginTop="16dp"
        app:bgDrawable="@drawable/bg_btn_logout"
        app:layout_constraintEnd_toEndOf="@+id/v_bg"
        app:layout_constraintStart_toStartOf="@+id/v_bg"
        app:layout_constraintTop_toBottomOf="@id/v_line2"
        app:textIcon="@drawable/bluetooth_sign_out" />


    <!--    Bottom Button-->
    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="40dp"
        android:visibility="gone"
        android:adjustViewBounds="true"
        android:scaleType="fitXY"
        android:src="@drawable/ic_btn_close"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bottom_guideline" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/btn_close"
        android:layout_width="150dp"
        android:layout_height="wrap_content"
        android:backgroundTint="@color/color_red_800"
        android:gravity="center"
        android:text="@string/close"
        android:textColor="@android:color/white"
        android:textSize="24sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/bottom_guideline" />
</androidx.constraintlayout.widget.ConstraintLayout>