<?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"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:tools="http://schemas.android.com/tools"
    android:background="@color/black">

    <ImageButton
        android:id="@+id/button_back"
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:contentDescription="@string/cd_button_back"
        android:padding="10dp"
        android:scaleType="fitCenter"
        app:srcCompat="@drawable/ic_back_thin_white_16dp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        />

    <TextView
        android:id="@+id/text_description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="Scan the QR code that is displayed on the device you want to link or paste the link code here"
        android:textColor="#ACACAC"
        android:fontFamily="@font/inter_extra_light"
        android:textSize="12dp"
        android:layout_marginTop="16dp"
        android:layout_marginStart="20dp"
        android:layout_marginEnd="20dp"
        app:layout_constraintTop_toBottomOf="@id/button_back"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent" />
    
    <EditText
        android:id="@+id/edit_code"
        android:layout_width="match_parent"
        android:layout_height="150dp"
        android:background="@drawable/background_1b_round_6dp"
        android:padding="16dp"
        android:fontFamily="@font/inter_regular"
        android:textSize="14dp"
        app:layout_constraintTop_toBottomOf="@id/text_description"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginStart="20dp"
        android:layout_marginEnd="20dp"
        android:layout_marginTop="31dp"
        android:gravity="start|top"
        android:hint="Input or paste your sync code here" />

    <LinearLayout
        android:id="@+id/button_scan_qr"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal"
        android:background="@drawable/background_border_2e_round_6dp"
        android:gravity="center"
        android:layout_marginStart="20dp"
        android:layout_marginEnd="20dp"
        android:layout_marginTop="16dp"
        app:layout_constraintTop_toBottomOf="@id/edit_code"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent">

        <ImageView
            android:layout_width="16dp"
            android:layout_height="16dp"
            app:srcCompat="@drawable/ic_qr"
            android:layout_marginRight="8dp"
            android:scaleType="fitCenter"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Scan QR"
            android:lines="1"
            android:fontFamily="@font/inter_regular"
            android:textSize="16dp"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/button_link_new_device"
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:orientation="horizontal"
        android:background="@drawable/background_019be7_round_6dp"
        android:gravity="center"
        android:layout_marginStart="20dp"
        android:layout_marginEnd="20dp"
        android:layout_marginBottom="20dp"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintBottom_toBottomOf="parent">

        <ImageView
            android:layout_width="16dp"
            android:layout_height="16dp"
            android:padding="2dp"
            app:srcCompat="@drawable/ic_add_white_8dp"
            android:layout_marginRight="8dp"
            android:scaleType="fitCenter"/>

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Link new device"
            android:lines="1"
            android:fontFamily="@font/inter_regular"
            android:textSize="16dp"/>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/layout_pairing"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#000000"
        app:layout_constraintTop_toBottomOf="@id/button_back"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone">

        <com.futo.platformplayer.views.LoaderView
            android:layout_width="32dp"
            android:layout_height="32dp" />

        <TextView
            android:id="@+id/text_pairing_status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Pairing..."
            android:textSize="16dp"
            android:fontFamily="@font/inter_regular"
            android:layout_marginTop="16dp" />
    </LinearLayout>

    <LinearLayout
        android:id="@+id/layout_pairing_success"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#000000"
        app:layout_constraintTop_toBottomOf="@id/button_back"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone">
        
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:layout_marginEnd="20dp"
            android:padding="24dp"
            android:orientation="vertical"
            android:gravity="center"
            android:background="@drawable/background_solid_border_2e_round_6dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:srcCompat="@drawable/ic_pair_success" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Device linked"
                android:textSize="20dp"
                android:layout_marginTop="8dp"
                android:fontFamily="@font/inter_regular"/>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:textColor="#8C8C8C"
                android:fontFamily="@font/inter_light"
                android:textSize="14dp"
                android:text="The device has been successfully linked" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/layout_pairing_error"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:background="#000000"
        app:layout_constraintTop_toBottomOf="@id/button_back"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:gravity="center"
        android:orientation="vertical"
        android:visibility="gone">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="20dp"
            android:layout_marginEnd="20dp"
            android:padding="24dp"
            android:orientation="vertical"
            android:gravity="center"
            android:background="@drawable/background_solid_border_2e_round_6dp">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:srcCompat="@drawable/ic_pair_fail" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Failed to link device"
                android:textSize="20dp"
                android:layout_marginTop="8dp"
                android:fontFamily="@font/inter_regular"/>

            <TextView
                android:id="@+id/text_error"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="#020202"
                android:layout_marginTop="16dp"
                android:textColor="#8C8C8C"
                android:fontFamily="@font/inter_light"
                android:textSize="12dp"
                android:isScrollContainer="true"
                android:scrollbars="vertical"
                android:maxHeight="200dp"
                android:text="An error has occurred" />
        </LinearLayout>
    </LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>