<?xml version="1.0" encoding="utf-8"?>

<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:tools="http://schemas.android.com/tools"
        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">

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

        <Button
                android:id="@+id/startButton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="32dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:drawableStart="@drawable/ic_new_match"
                android:drawableLeft="@drawable/ic_new_match"
                android:onClick="startMatch"
                android:text="@string/start"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/enableSttSwitch" />

        <TextView
                android:id="@+id/WhoStarts"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="32dp"
                android:text="@string/who_starts"
                android:textAppearance="@style/TextAppearance.AppCompat.Headline"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

        <RadioGroup
                android:id="@+id/starterRadioGroup"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:orientation="horizontal"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/WhoStarts">

            <RadioButton
                    android:id="@+id/radioPlayer1Starts"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:checked="true"
                    tools:layout_editor_absoluteX="16dp"
                    tools:layout_editor_absoluteY="93dp" />

            <AutoCompleteTextView
                    android:id="@+id/player1Name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:completionThreshold="1"
                    android:hint="@string/player_1_default_name"
                    android:imeOptions="actionNext"
                    android:singleLine="true"
                    android:text="@string/player_1_default_name"
                    tools:layout_editor_absoluteX="143dp"
                    tools:layout_editor_absoluteY="48dp" />

            <ImageButton
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:contentDescription="@string/swap_names"
                    android:onClick="swapNames"
                    app:srcCompat="@drawable/ic_swap_horiz" />

            <RadioButton
                    android:id="@+id/radioPlayer2Starts"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="0"
                    android:checked="true"
                    tools:layout_editor_absoluteX="16dp"
                    tools:layout_editor_absoluteY="93dp" />

            <AutoCompleteTextView
                    android:id="@+id/player2Name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:completionThreshold="1"
                    android:hint="@string/player_2_default_name"
                    android:imeOptions="actionNext"
                    android:singleLine="true"
                    android:text="@string/player_2_default_name"
                    tools:layout_editor_absoluteX="136dp" />
        </RadioGroup>

        <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/enableTtsSwitch"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:text="@string/TTS"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/starterRadioGroup" />

        <com.google.android.material.switchmaterial.SwitchMaterial
                android:id="@+id/enableSttSwitch"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="32dp"
                android:layout_marginLeft="32dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="32dp"
                android:layout_marginRight="32dp"
                android:text="@string/STT"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/enableTtsSwitch" />

    </androidx.constraintlayout.widget.ConstraintLayout>

</androidx.coordinatorlayout.widget.CoordinatorLayout>