<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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">

    <include
        android:id="@+id/toolbar_layout"
        layout="@layout/layout_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toTopOf="@+id/layout_container"
        app:layout_constraintTop_toTopOf="parent" />

    <com.wang.avi.AVLoadingIndicatorView
        android:id="@+id/view_loading"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:visibility="gone"
        app:indicatorColor="@color/colorBlack"
        app:indicatorName="BallPulseIndicator"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/toolbar_layout"
        tools:visibility="visible" />

    <android.support.constraint.ConstraintLayout
        android:id="@+id/layout_container"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:paddingTop="16dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/toolbar_layout">

        <android.support.constraint.Guideline
            android:id="@+id/button_top_guideline"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintGuide_percent="0.03" />

        <android.support.constraint.Guideline
            android:id="@+id/button_bottom_guideline"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            app:layout_constraintGuide_percent="0.09" />

        <Button
            android:id="@+id/public_channel"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:background="@drawable/button_solid"
            android:text="@string/public_channel_type"
            android:textColor="@color/default_background"
            app:layout_constraintBottom_toBottomOf="@id/button_bottom_guideline"
            app:layout_constraintEnd_toStartOf="@+id/private_channel"
            app:layout_constraintHorizontal_chainStyle="packed"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/button_top_guideline" />

        <Button
            android:id="@+id/private_channel"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:background="@drawable/button_border"
            android:text="@string/private_channel_type"
            android:textColor="@color/colorRed"
            app:layout_constraintBottom_toBottomOf="@id/button_bottom_guideline"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/public_channel"
            app:layout_constraintTop_toTopOf="@id/button_top_guideline" />

        <TextView
            android:id="@+id/channel_type"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="16dp"
            android:text="@string/public_channel_type"
            android:textColor="@color/colorPrimaryText"
            android:textSize="16sp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/public_channel" />

        <TextView
            android:id="@+id/channel_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="16dp"
            android:layout_marginTop="4dp"
            android:text="@string/public_channel_description"
            android:textColor="@color/colorSecondaryText"
            android:textSize="12sp"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/channel_type" />

        <View
            android:id="@+id/separator_1"
            android:layout_width="0dp"
            android:layout_height="0.5dp"
            android:layout_marginTop="8dp"
            android:background="@color/colorDividerMessageComposer"
            app:layout_constraintTop_toBottomOf="@id/channel_description" />

        <ImageView
            android:id="@+id/placeholder"
            android:layout_width="wrap_content"
            android:layout_height="0dp"
            android:layout_marginStart="16dp"
            android:layout_marginTop="8dp"
            android:src="@drawable/ic_hashtag_black_12dp"
            app:layout_constraintBottom_toBottomOf="@id/channel_name_text_input_layout"
            app:layout_constraintEnd_toStartOf="@id/channel_name_text_input_layout"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/channel_name_text_input_layout" />

        <android.support.design.widget.TextInputLayout
            android:id="@+id/channel_name_text_input_layout"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="16dp"
            android:layout_marginStart="8dp"
            android:layout_marginTop="8dp"
            android:focusable="true"
            android:hint="@string/msg_channel_name"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toEndOf="@id/placeholder"
            app:layout_constraintTop_toBottomOf="@id/separator_1">

            <android.support.design.widget.TextInputEditText
                android:id="@+id/channel_name_edit_text"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:textSize="16sp" />
        </android.support.design.widget.TextInputLayout>

        <View
            android:id="@+id/separator_2"
            android:layout_width="0dp"
            android:layout_height="0.5dp"
            android:layout_marginTop="8dp"
            android:background="@color/colorDividerMessageComposer"
            app:layout_constraintTop_toBottomOf="@id/channel_name_text_input_layout" />

        <android.support.constraint.ConstraintLayout
            android:id="@+id/add_members_view"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?attr/selectableItemBackground"
            android:paddingBottom="8dp"
            android:paddingTop="8dp"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/separator_2">

            <TextView
                android:id="@+id/add_members_text"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                android:text="@string/msg_add_members"
                android:textColor="@color/colorSecondaryText"
                android:textSize="16sp"
                app:layout_constraintHorizontal_chainStyle="spread"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_marginTop="8dp"
                android:src="@drawable/ic_person_add_black_24dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintHorizontal_bias="1"
                app:layout_constraintStart_toEndOf="@id/add_members_text"
                app:layout_constraintTop_toTopOf="parent" />

            <android.support.design.chip.ChipGroup
                android:id="@+id/selected_members_chips"
                style="@style/Widget.MaterialComponents.Chip.Entry"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_marginStart="16dp"
                android:layout_marginTop="8dp"
                app:chipSpacing="3dp"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@id/add_members_text">

            </android.support.design.chip.ChipGroup>
        </android.support.constraint.ConstraintLayout>

        <View
            android:id="@+id/separator_3"
            android:layout_width="0dp"
            android:layout_height="0.5dp"
            android:background="@color/colorDividerMessageComposer"
            app:layout_constraintTop_toBottomOf="@id/add_members_view" />

    </android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>