<?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">

    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/channelNameView"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="64dp"
        android:layout_marginTop="16dp"
        android:layout_marginEnd="64dp"
        android:hint="@string/channel_name"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <com.google.android.material.textfield.TextInputEditText
            android:id="@+id/channelNameEdit"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:digits="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890- "
            android:hint="@string/channel_name"
            android:imeOptions="actionDone"
            android:maxLength="11"
            android:singleLine="true"
            android:text="@string/unset" />
    </com.google.android.material.textfield.TextInputLayout>

    <ImageView
        android:id="@+id/qrView"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:contentDescription="@string/qr_code"
        app:layout_constraintBottom_toTopOf="@+id/channelOptions"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/channelNameView"
        app:srcCompat="@drawable/qrcode" />

    <!--
    geeksville: no longer used but keeping as a good example of a button group.  instead I use
    a toggleable icon.

        <com.google.android.material.button.MaterialButtonToggleGroup
        android:id="@+id/editGroup"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="96dp"
        android:layout_marginTop="16dp"
        app:layout_constraintStart_toStartOf="parent"
        app:singleSelection="true"
        app:selectionRequired="true"
        app:layout_constraintTop_toBottomOf="@+id/channelOptions">

        <Button
            android:id="@+id/locked"
            style="@style/Widget.App.Button.OutlinedButton.IconOnly"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:icon="@drawable/ic_twotone_lock_24" />

        <Button
            android:id="@+id/unlocked"
            style="@style/Widget.App.Button.OutlinedButton.IconOnly"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            app:icon="@drawable/ic_twotone_lock_open_24" />
    </com.google.android.material.button.MaterialButtonToggleGroup>
    -->
    <com.google.android.material.textfield.TextInputLayout
        android:id="@+id/channelOptions"
        style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginStart="64dp"
        android:layout_marginEnd="64dp"
        android:layout_marginBottom="16dp"
        android:hint="@string/channel_options"
        app:layout_constraintBottom_toTopOf="@+id/editableCheckbox"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent">

        <AutoCompleteTextView
            android:id="@+id/filled_exposed_dropdown"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.google.android.material.textfield.TextInputLayout>

    <CheckBox
        android:id="@+id/editableCheckbox"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="96dp"
        android:layout_marginEnd="32dp"
        android:layout_marginBottom="16dp"
        android:button="@drawable/sl_lock_24dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/shareButton"
        app:layout_constraintStart_toStartOf="parent"></CheckBox>

    <ImageButton
        android:id="@+id/shareButton"
        style="@android:style/Widget.Material.ImageButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="96dp"
        android:contentDescription="@string/share"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="@+id/editableCheckbox"
        app:srcCompat="@drawable/ic_twotone_share_24" />

</androidx.constraintlayout.widget.ConstraintLayout>