<?xml version="1.0" encoding="utf-8"?><!--
    Copyright 2021 Thomas Schneider

    This file is a part of Fedilab

    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation; either version 3 of the
    License, or (at your option) any later version.

    Fedilab is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
    the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
    Public License for more details.

    You should have received a copy of the GNU General Public License along with Fedilab; if not,
    see <http://www.gnu.org/licenses>
-->
<com.google.android.material.card.MaterialCardView 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:id="@+id/cardview_container"
    style="@style/Widget.Material3.CardView.Elevated"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginHorizontal="6dp"
    android:layout_marginTop="6dp"
    android:clipChildren="false"
    android:clipToPadding="false">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipToPadding="false"
        android:orientation="vertical">

        <androidx.core.widget.NestedScrollView
            android:id="@+id/laTexView_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

        </androidx.core.widget.NestedScrollView>
        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/genders"
            android:visibility="gone"
            tools:visibility="visible"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintEnd_toStartOf="@id/button_emoji"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/laTexView_container"
            android:orientation="horizontal"
            android:layout_marginStart="6dp"
            >
            <com.google.android.material.textview.MaterialTextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/Pronouns"/>
            <com.google.android.material.textview.MaterialTextView
                android:layout_marginStart="10dp"
                android:id="@+id/pronouns"
                style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
                android:textColor="?colorPrimary"
                tools:text="He/Him"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"/>
        </androidx.appcompat.widget.LinearLayoutCompat>
        <com.google.android.material.textfield.MaterialAutoCompleteTextView
            android:id="@+id/content_spoiler"
            android:layout_width="0dp"
            android:textCursorDrawable="@drawable/color_cursor"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:layout_marginTop="6dp"
            android:hint="@string/eg_sensitive_content"
            android:inputType="textMultiLine|textCapSentences"
            android:singleLine="true"
            android:visibility="gone"
            app:layout_constraintEnd_toStartOf="@id/button_emoji"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/genders"
            tools:visibility="visible" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/add_remove_status"
            style="@style/Fedilab.SmallIconButton"
            android:layout_marginTop="6dp"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/add_status"
            app:icon="@drawable/ic_compose_thread_add_status"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/laTexView_container" />

        <app.fedilab.android.mastodon.helper.FedilabAutoCompleteTextView
            android:id="@+id/content"
            android:layout_width="0dp"
            android:textCursorDrawable="@drawable/color_cursor"
            android:layout_height="wrap_content"
            android:layout_marginStart="6dp"
            android:focusable="true"
            android:gravity="top|start"
            android:inputType="textMultiLine|textCapSentences"
            android:minLines="10"
            app:layout_constraintEnd_toStartOf="@id/button_emoji"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/content_spoiler" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_emoji"
            style="@style/Fedilab.SmallIconButton"
            app:layout_goneMarginTop="48dp"
            android:layout_marginTop="6dp"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/emoji_picker"
            app:icon="@drawable/ic_compose_emoji"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/add_remove_status" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_emoji_one"
            style="@style/Fedilab.SmallIconButton"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/emoji_picker"
            android:visibility="gone"
            app:icon="@drawable/ic_baseline_insert_emoticon_24"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/button_emoji"
            tools:visibility="visible" />


        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_text_format"
            style="@style/Fedilab.SmallIconButton"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/post_format"
            android:visibility="gone"
            app:icon="@drawable/ic_baseline_format_size_24"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/button_emoji_one"
            tools:visibility="visible" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_maths_composer"
            style="@style/Fedilab.SmallIconButton"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/maths_format"
            android:visibility="gone"
            app:icon="@drawable/ic_baseline_functions_24"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/button_text_format"
            tools:visibility="visible" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_local_only"
            style="@style/Fedilab.SmallIconButton"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/local_only"
            android:visibility="gone"
            app:icon="@drawable/ic_baseline_remove_red_eye_24"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/button_maths_composer"
            tools:visibility="visible" />



        <com.google.android.material.divider.MaterialDivider
            android:id="@+id/text_area_divider"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="6dp"
            app:layout_constraintTop_toBottomOf="@id/content" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_attach"
            style="@style/Widget.Material3.Button.IconButton.Outlined"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="6dp"
            android:layout_marginStart="6dp"
            android:contentDescription="@string/open_new_attachment_panel"
            app:icon="@drawable/ic_compose_attach"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/text_area_divider" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_sensitive"
            style="@style/Widget.Material3.Button.IconButton.Outlined"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="6dp"
            android:checkable="true"
            android:contentDescription="@string/add_content_warning"
            app:icon="@drawable/ic_compose_sensitive"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintStart_toEndOf="@id/button_attach"
            app:layout_constraintTop_toBottomOf="@id/text_area_divider"
            app:toggleCheckedStateOnClick="true" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_visibility"
            style="@style/Widget.Material3.Button.IconButton.Outlined"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="6dp"
            android:contentDescription="@string/change_visibility"
            app:icon="@drawable/ic_compose_visibility_public"
            app:iconGravity="textStart"
            app:iconPadding="0dp"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintStart_toEndOf="@id/button_sensitive"
            app:layout_constraintTop_toBottomOf="@id/text_area_divider" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_language"
            style="@style/Widget.Material3.Button.TextButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="6dp"
            android:contentDescription="@string/set_language"
            android:fontFamily="monospace"
            android:minWidth="72dp"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintStart_toEndOf="@id/button_visibility"
            app:layout_constraintTop_toBottomOf="@id/text_area_divider"
            tools:text="EN" />

        <com.google.android.material.textview.MaterialTextView
            android:id="@+id/character_count"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="6dp"
            android:text="0"
            app:layout_constraintBottom_toTopOf="@id/character_progress"
            app:layout_constraintEnd_toStartOf="@id/button_post"
            app:layout_constraintStart_toEndOf="@id/button_language"
            app:layout_constraintTop_toBottomOf="@id/text_area_divider"
            app:layout_constraintVertical_chainStyle="packed"
            tools:ignore="HardcodedText" />

        <ProgressBar
            android:id="@+id/character_progress"
            style="@style/Widget.AppCompat.ProgressBar.Horizontal"
            android:layout_width="48dp"
            android:layout_height="12dp"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintEnd_toStartOf="@id/button_post"
            app:layout_constraintStart_toEndOf="@id/button_language"
            app:layout_constraintTop_toBottomOf="@id/character_count" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_post"
            style="@style/Widget.Material3.Button.IconButton.Filled"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginVertical="6dp"
            android:layout_marginEnd="6dp"
            android:contentDescription="@string/action_publish"
            app:icon="@drawable/ic_compose_post"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toBottomOf="@id/text_area_divider" />

        <androidx.constraintlayout.helper.widget.Flow
            android:id="@+id/attachment_choices_panel"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_compose_panels"
            android:padding="6dp"
            android:visibility="gone"
            app:constraint_referenced_ids="button_attach_image,button_attach_audio,button_attach_video,button_close_attachment_panel,button_poll,button_attach_manual"
            app:flow_maxElementsWrap="3"
            app:flow_wrapMode="aligned"
            app:layout_constraintBottom_toBottomOf="@id/button_attach"
            app:layout_constraintStart_toStartOf="parent" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_attach_image"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/attach_images"
            app:icon="@drawable/ic_compose_attach_image" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_attach_audio"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/attach_audio"
            app:icon="@drawable/ic_compose_attach_audio" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_attach_video"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/attach_videos"
            app:icon="@drawable/ic_compose_attach_video" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_close_attachment_panel"
            style="@style/Widget.Material3.Button.IconButton.Outlined"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/close_new_attachment_panel"
            app:icon="@drawable/ic_baseline_close_24" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_poll"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/add_poll"
            app:icon="@drawable/ic_compose_poll" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/button_attach_manual"
            style="@style/Widget.Material3.Button.IconButton"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:contentDescription="@string/attach_files"
            app:icon="@drawable/ic_compose_attach_more" />

        <androidx.appcompat.widget.LinearLayoutCompat
            android:id="@+id/visibility_panel"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@drawable/bg_compose_panels"
            android:gravity="bottom"
            android:orientation="vertical"
            android:padding="6dp"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintVertical_bias="1">

            <com.google.android.material.button.MaterialButtonToggleGroup
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:id="@+id/visibility_group"
                android:padding="6dp"
                app:singleSelection="true">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/button_visibility_direct"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:minHeight="36dp"
                    android:text="@string/v_direct"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_direct" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/button_visibility_private"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:minHeight="36dp"
                    android:text="@string/followers_only"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_private" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/button_visibility_unlisted"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:minHeight="36dp"
                    android:text="@string/v_unlisted"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_unlisted" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/button_visibility_public"
                    style="@style/Widget.Material3.Button.OutlinedButton"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:insetTop="0dp"
                    android:insetBottom="0dp"
                    android:minHeight="36dp"
                    android:text="@string/v_public"
                    android:textAlignment="textStart"
                    app:icon="@drawable/ic_compose_visibility_public" />

            </com.google.android.material.button.MaterialButtonToggleGroup>

            <com.google.android.material.button.MaterialButton
                android:id="@+id/button_close_visibility_panel"
                style="@style/Widget.Material3.Button.IconButton.Outlined"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="96dp"
                app:icon="@drawable/ic_baseline_close_24" />

        </androidx.appcompat.widget.LinearLayoutCompat>

        <androidx.constraintlayout.widget.Barrier
            android:id="@+id/action_buttons_barrier"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:barrierDirection="bottom"
            app:constraint_referenced_ids="button_attach,button_visibility, button_language,  button_post, character_progress, button_sensitive" />


        <com.google.android.material.checkbox.MaterialCheckBox
            android:id="@+id/sensitive_media"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="6dp"
            android:layout_marginTop="6dp"
            android:minHeight="36dp"
            android:text="@string/toot_sensitive"
            android:visibility="gone"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_bias="0"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/action_buttons_barrier"
            app:layout_constraintWidth_default="wrap" />

        <HorizontalScrollView
            android:id="@+id/attachments_list_container"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="6dp"
            app:layout_constraintTop_toBottomOf="@id/sensitive_media">

            <androidx.appcompat.widget.LinearLayoutCompat
                android:id="@+id/attachments_list"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:clipToPadding="false"
                android:paddingEnd="6dp"
                tools:ignore="RtlSymmetry" />

        </HorizontalScrollView>

    </androidx.constraintlayout.widget.ConstraintLayout>

</com.google.android.material.card.MaterialCardView>
