<?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:padding="@dimen/spacing_4x">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/llContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:orientation="horizontal"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/ivLogo"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:src="@drawable/ic_firezone_logo"
            app:layout_constraintDimensionRatio="1:1"
            app:layout_constraintTop_toTopOf="@id/tvHeaderTitle"
            app:layout_constraintBottom_toBottomOf="@id/tvHeaderTitle"
            app:layout_constraintEnd_toStartOf="@id/tvHeaderTitle" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/tvHeaderTitle"
            style="@style/AppTheme.Base.HeaderText"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/spacing_small"
            android:gravity="center"
            android:text="@string/app_short_name"
            app:layout_constraintStart_toEndOf="@id/ivLogo"
            app:layout_constraintTop_toTopOf="parent" />

    </androidx.constraintlayout.widget.ConstraintLayout>

    <TextView
        android:id="@+id/tvSettings"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        style="@style/AppTheme.Base.H5"
        android:text="@string/settings_title"
        android:layout_marginTop="@dimen/spacing_4x"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/llContainer" />

    <TextView
        android:id="@+id/tvAdvancedSettings"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/advanced_settings_title"
        android:textSize="16sp"
        android:textStyle="bold"
        android:layout_marginTop="@dimen/spacing_4x"
        app:layout_constraintTop_toBottomOf="@id/tvSettings"
        app:layout_constraintStart_toStartOf="parent" />

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ilAuthBaseUrlInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_1x"
        app:errorEnabled="true"
        app:layout_constraintTop_toBottomOf="@id/tvAdvancedSettings"
        app:layout_constraintStart_toStartOf="parent">

    <com.google.android.material.textfield.TextInputEditText
        android:id="@+id/etAuthBaseUrlInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:hint="@string/auth_base_url"
        android:importantForAutofill="no"
        android:inputType="text" />

    </com.google.android.material.textfield.TextInputLayout>
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ilApiUrlInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_1x"
        app:errorEnabled="true"
        app:layout_constraintTop_toBottomOf="@id/ilAuthBaseUrlInput"
        app:layout_constraintStart_toStartOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/etApiUrlInput"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/api_url"
            android:importantForAutofill="no"
            android:inputType="text" />

    </com.google.android.material.textfield.TextInputLayout>
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/ilLogFilterInput"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/spacing_1x"
        app:errorEnabled="true"
        app:layout_constraintTop_toBottomOf="@id/ilApiUrlInput"
        app:layout_constraintStart_toStartOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/etLogFilterInput"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/log_filter"
            android:importantForAutofill="no"
            android:inputType="text" />

    </com.google.android.material.textfield.TextInputLayout>

    <com.google.android.material.button.MaterialButton
        android:id="@+id/btShareLog"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/share_diagnostic_logs"
        style="?attr/materialIconButtonOutlinedStyle"
        app:icon="@drawable/ic_share"
        app:iconGravity="textStart"
        app:iconPadding="@dimen/spacing_small"
        app:layout_constraintTop_toTopOf="@id/tvSettings"
        app:layout_constraintBottom_toBottomOf="@id/tvSettings"
        app:layout_constraintEnd_toEndOf="parent" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/btCancel"
        style="?attr/materialIconButtonOutlinedStyle"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:enabled="true"
        android:text="@android:string/cancel"
        android:layout_marginEnd="@dimen/spacing_2x"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@id/btSaveSettings" />

    <com.google.android.material.button.MaterialButton
        android:id="@+id/btSaveSettings"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:enabled="false"
        android:text="@string/save"
        android:layout_marginStart="@dimen/spacing_2x"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@id/btCancel" />

</androidx.constraintlayout.widget.ConstraintLayout>
