<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/activity_esptouch"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="45dp"
        android:background="@color/white">

        <ImageView
            android:id="@+id/iv_base_activity_back"
            android:layout_width="@dimen/x90"
            android:layout_height="45dp"
            android:layout_alignParentLeft="true"
            android:layout_centerVertical="true"
            android:padding="15dp"
            android:src="@mipmap/back" />

        <TextView
            android:id="@+id/tv_title_center"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:textColor="@color/black_text_color"
            android:textSize="18sp" />

        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_alignParentBottom="true"
            android:background="@color/home_background"></View>
    </RelativeLayout>

    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:padding="16dp">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/content"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

            <TextView
                android:id="@+id/apSsidLabel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:text="@string/esptouch1_ssid_title"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/colorAccent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/apSsidText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:singleLine="true"
                android:textAppearance="?android:attr/textAppearanceMedium"
                app:layout_constraintBaseline_toBaselineOf="@id/apSsidLabel"
                app:layout_constraintStart_toEndOf="@id/apSsidLabel"
                app:layout_constraintTop_toTopOf="parent" />

            <TextView
                android:id="@+id/apBssidLabel"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:singleLine="true"
                android:text="@string/esptouch1_bssid_title"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="@color/colorAccent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/apSsidLabel" />

            <TextView
                android:id="@+id/apBssidText"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="4dp"
                android:singleLine="true"
                android:textAppearance="?android:attr/textAppearanceMedium"
                app:layout_constraintBaseline_toBaselineOf="@id/apBssidLabel"
                app:layout_constraintStart_toEndOf="@id/apBssidLabel"
                app:layout_constraintTop_toTopOf="@id/apBssidLabel" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/apPasswordLayout"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:hint="@string/esptouch1_password_title"
                app:layout_constraintTop_toBottomOf="@id/apBssidLabel"
                app:passwordToggleEnabled="true">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/apPasswordEdit"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:inputType="textPassword"
                    android:singleLine="true" />
            </com.google.android.material.textfield.TextInputLayout>

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/deviceCountLayout"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:hint="@string/esptouch1_device_count_title"
                android:visibility="invisible"
                app:layout_constraintTop_toBottomOf="@id/apPasswordLayout">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/deviceCountEdit"
                    android:layout_width="120dp"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:text="1" />
            </com.google.android.material.textfield.TextInputLayout>

            <RadioGroup
                android:id="@+id/packageModeGroup"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:orientation="horizontal"
                android:visibility="invisible"
                app:layout_constraintTop_toBottomOf="@id/deviceCountLayout">

                <RadioButton
                    android:id="@+id/packageBroadcast"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="true"
                    android:text="@string/esptouch1_package_broadcast" />

                <RadioButton
                    android:id="@+id/packageMulticast"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="16dp"
                    android:text="@string/esptouch1_package_multicast"
                    android:visibility="gone" />
            </RadioGroup>

            <TextView
                android:id="@+id/messageView"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="top"
                android:textColor="@android:color/holo_red_dark"
                app:layout_constraintTop_toBottomOf="@id/packageModeGroup"
                app:layout_goneMarginStart="4dp" />

            <com.google.android.material.button.MaterialButton
                android:id="@+id/confirmBtn"
                android:layout_width="match_parent"
                android:layout_height="45dp"
                android:gravity="center"
                android:textColor="@color/white"
                android:text="@string/esptouch1_confirm"
                android:textAppearance="@color/base_blue"
                android:textSize="14sp"
                app:layout_constraintBottom_toBottomOf="parent" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/progressView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            android:gravity="center"
            android:orientation="vertical"
            android:visibility="gone">

            <TextView
                android:id="@+id/testResult"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <ProgressBar
                android:id="@+id/progressBar"
                style="?android:attr/progressBarStyleLarge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <Button
                android:id="@+id/cancel_button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="16dp"
                android:text="@android:string/cancel"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/progressBar" />
        </androidx.constraintlayout.widget.ConstraintLayout>
    </FrameLayout>
</LinearLayout>



