<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <FrameLayout
        android:id="@+id/panels_root"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1">

        <androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/options_root"
            android:layout_width="match_parent"
            android:layout_height="180dp"
            android:orientation="vertical"
            android:padding="8dp"
            android:visibility="gone"
            tools:visibility="visible">

            <ImageButton
                android:id="@+id/icon_preview"
                android:layout_width="64dp"
                android:layout_height="64dp"
                android:layout_gravity="center"
                android:scaleType="centerInside"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                tools:ignore="ContentDescription"
                tools:src="@drawable/ic_asterisk" />

            <com.google.android.material.textfield.TextInputLayout
                android:id="@+id/group_name_input_container"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:gravity="center_vertical"
                android:hint="@string/name"
                android:paddingTop="6dp"
                android:paddingBottom="6dp"
                app:errorEnabled="true"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toEndOf="@+id/icon_preview"
                app:layout_constraintTop_toTopOf="parent">

                <EditText
                    android:id="@+id/group_name_input"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:importantForAutofill="no"
                    android:inputType="textCapSentences"
                    android:maxLines="1"
                    tools:ignore="LabelFor,UnusedAttribute" />

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


            <TextView
                android:id="@+id/selected_subscription_count_view"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="6dp"
                android:textAppearance="@style/TextAppearance.AppCompat.Caption"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/group_name_input_container"
                tools:text="15 selected" />

            <Button
                android:id="@+id/select_channel_button"
                style="@style/Widget.AppCompat.Button.Borderless"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginBottom="4dp"
                android:text="@string/feed_group_dialog_select_subscriptions"
                android:textAllCaps="true"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/selected_subscription_count_view" />
        </androidx.constraintlayout.widget.ConstraintLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/icon_selector"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:padding="4dp"
            android:paddingTop="16dp"
            android:paddingBottom="16dp"
            android:visibility="gone"
            tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
            tools:listitem="@layout/picker_icon_item"
            tools:spanCount="7" />

        <LinearLayout
            android:id="@+id/subscriptions_selector"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/subscriptions_header_toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:gravity="center_vertical"
                android:theme="@style/ContrastToolbarTheme">

                <LinearLayout
                    android:id="@+id/subscriptions_header_info_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="vertical">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="start|center_vertical"
                        android:text="@string/tab_subscriptions"
                        android:textColor="?android:attr/textColorPrimary"
                        android:textSize="16sp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/subscriptions_header_info"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="start|center_vertical"
                        android:textColor="?android:attr/textColorPrimary"
                        android:textSize="12sp"
                        tools:text="1 selected" />
                </LinearLayout>

                <include
                    android:id="@+id/subscriptions_header_search_container"
                    layout="@layout/toolbar_search_layout"
                    android:visibility="gone" />

            </androidx.appcompat.widget.Toolbar>

            <androidx.recyclerview.widget.RecyclerView
                android:id="@+id/subscriptions_selector_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:padding="2dp"
                tools:itemCount="200"
                tools:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
                tools:listitem="@layout/picker_subscription_item"
                tools:spanCount="4" />
        </LinearLayout>

        <TextView
            android:id="@+id/delete_screen_message"
            style="@style/TextAppearance.AppCompat.Subhead"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="start"
            android:paddingLeft="?dialogPreferredPadding"
            android:paddingTop="16dp"
            android:paddingRight="?dialogPreferredPadding"
            android:paddingBottom="16dp"
            android:text="@string/feed_group_dialog_delete_message"
            android:visibility="visible" />
    </FrameLayout>

    <View
        android:id="@+id/separator"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="?attr/separator_color" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center_vertical"
        android:paddingLeft="12dp"
        android:paddingTop="4dp"
        android:paddingRight="12dp"
        android:paddingBottom="4dp">

        <ImageButton
            android:id="@+id/delete_button"
            style="?buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentStart="true"
            android:layout_centerVertical="true"
            android:minWidth="0dp"
            android:scaleType="centerInside"
            android:visibility="gone"
            app:srcCompat="@drawable/ic_delete"
            tools:ignore="ContentDescription"
            tools:visibility="visible" />

        <Button
            android:id="@+id/cancel_button"
            style="?buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_toStartOf="@+id/confirm_button"
            android:text="@android:string/cancel" />

        <Button
            android:id="@+id/confirm_button"
            style="?buttonBarButtonStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:text="@string/create" />
    </RelativeLayout>
</LinearLayout>
