<?xml version="1.0" encoding="utf-8"?>
<org.joinmastodon.android.ui.views.SizeListenerLinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:tools="http://schemas.android.com/tools"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	android:orientation="vertical"
	android:layout_width="match_parent"
	android:layout_height="match_parent">

	<ScrollView
		android:id="@+id/scroll_view"
		android:layout_width="match_parent"
		android:layout_height="0dp"
		android:layout_weight="1"
		android:fillViewport="true">

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

			<LinearLayout
				android:id="@+id/original_post"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:orientation="vertical"
				android:visibility="gone"
				android:background="?android:selectableItemBackground">
				<include layout="@layout/display_item_header" />
				<TextView
					android:id="@+id/reply_to_spoiler"
					android:visibility="gone"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginHorizontal="16dp"
					android:layout_marginTop="16dp"
					android:paddingVertical="12dp"
					android:paddingHorizontal="21dp"
					android:textAppearance="@style/m3_body_large"
					android:textColor="?colorM3OnSecondaryContainer"
					android:background="@drawable/bg_cw_edit" />
				<include layout="@layout/display_item_text" />
				<View
					android:layout_width="match_parent"
					android:layout_height="1dp"
					android:background="?colorM3OutlineVariant"/>

			</LinearLayout>
			
			<LinearLayout
				android:id="@+id/reply_wrap"
				android:orientation="vertical"
				android:layout_width="match_parent"
				android:layout_height="wrap_content">
				<TextView
					android:id="@+id/reply_text"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginLeft="16dp"
					android:layout_marginRight="16dp"
					android:layout_marginTop="16dp"
					android:textAppearance="@style/m3_title_small"
					android:drawableStart="@drawable/ic_fluent_arrow_reply_20_filled"
					android:drawableTint="?colorM3OnSurfaceVariant"
					android:drawablePadding="6dp"
					android:textColor="?colorM3OnSurfaceVariant"
					android:singleLine="true"
					android:text="@string/sk_in_reply"
					android:ellipsize="end"/>

				<RelativeLayout
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:paddingRight="16dp"
					android:paddingLeft="16dp">

					<ImageView
						android:id="@+id/self_avatar"
						android:layout_width="46sp"
						android:layout_height="46sp"
						android:layout_marginTop="16dp"
						android:layout_alignParentStart="true"
						android:layout_alignParentTop="true"
						android:layout_marginEnd="12dp" />

					<org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout
						android:id="@+id/name_wrap"
						android:layout_width="match_parent"
						android:layout_height="wrap_content"
						android:layout_toEndOf="@id/self_avatar"
						android:layout_toStartOf="@id/btn_visibility"
						android:layout_marginEnd="8dp"
						android:layout_above="@+id/self_username">

						<TextView
							android:id="@+id/self_name"
							android:layout_width="wrap_content"
							android:layout_height="wrap_content"
							android:ellipsize="end"
							android:singleLine="true"
							android:textAppearance="@style/m3_title_medium"
							android:textColor="?colorM3OnSurface"
							android:gravity="start|center_vertical"
							tools:text="Eugen" />

						<TextView
							android:id="@+id/self_extra_text"
							android:layout_width="wrap_content"
							android:layout_height="wrap_content"
							android:layout_marginStart="8sp"
							android:ellipsize="end"
							android:singleLine="true"
							android:textAppearance="@style/m3_body_medium"
							android:textAlignment="viewStart"
							android:textColor="?colorM3OnSurface"
							tools:text="@string/sk_inline_local_only" />

					</org.joinmastodon.android.ui.views.HeaderSubtitleLinearLayout>

					<TextView
						android:id="@+id/self_username"
						android:layout_width="match_parent"
						android:layout_height="wrap_content"
						android:layout_alignBottom="@id/self_avatar"
						android:layout_marginEnd="8dp"
						android:layout_toStartOf="@id/btn_visibility"
						android:layout_toEndOf="@id/self_avatar"
						android:layout_marginBottom="3sp"
						android:singleLine="true"
						android:ellipsize="end"
						android:textAppearance="@style/m3_body_medium"
						android:gravity="center_vertical"
						android:textColor="?colorM3OnSurfaceVariant"
						tools:text="9h ago · \@Gargron@mastodon.social"/>

					<Button
						android:id="@+id/btn_visibility"
						android:layout_width="wrap_content"
						android:layout_height="48dp"
						android:layout_alignParentEnd="true"
						android:layout_marginTop="8dp"
						android:textAppearance="@style/m3_label_large"
						android:background="@drawable/bg_filter_chip"
						android:textColor="@color/filter_chip_text"
						android:drawableTint="@color/m3_primary_selector"
						android:paddingStart="8dp"
						android:paddingEnd="8dp"
						android:drawablePadding="8dp"
						tools:text="@string/visibility_public"/>

				</RelativeLayout>

				<org.joinmastodon.android.ui.views.FloatingHintEditTextLayout
					android:id="@+id/content_warning_wrap"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:layout_marginTop="16dp"
					android:layout_marginLeft="16dp"
					android:layout_marginRight="16dp"
					android:paddingTop="8dp"
					android:paddingBottom="8dp"
					android:visibility="gone"
					android:background="@drawable/bg_cw_edit"
					android:addStatesFromChildren="true"
					app:labelTextColor="?colorM3Primary"
					app:editTextOffsetY="8dp"
					tools:visibility="visible">
					<EditText
						android:id="@+id/content_warning"
						android:layout_width="match_parent"
						android:layout_height="wrap_content"
						android:elevation="0dp"
						android:hint="@string/content_warning"
						android:inputType="textMultiLine|textCapSentences"
						android:textColorHint="?colorM3OnSurfaceVariant"
						android:paddingLeft="21dp"
						android:paddingRight="21dp"
						android:paddingTop="8dp"
						android:paddingBottom="8dp"
						android:minHeight="40dp"
						android:textAppearance="@style/m3_body_large"
						android:textColor="?colorM3OnSurface"
						android:background="@null"
						android:maxLines="3"/>
				</org.joinmastodon.android.ui.views.FloatingHintEditTextLayout>

				<FrameLayout
					android:id="@+id/toot_text_wrap"
					android:layout_width="match_parent"
					android:layout_height="wrap_content">

					<org.joinmastodon.android.ui.views.ComposeEditText
						android:id="@+id/toot_text"
						android:layout_width="match_parent"
						android:layout_height="wrap_content"
						android:paddingLeft="16dp"
						android:paddingRight="16dp"
						android:paddingBottom="16dp"
						android:paddingTop="12dp"
						android:textAppearance="@style/m3_body_large"
						android:textSize="16sp"
						android:gravity="top"
						android:background="@null"
						android:hint="@string/compose_hint"
						android:elevation="0dp"
						android:textColor="?colorM3OnSurface"
						android:textColorHint="?colorM3OnSurfaceVariant"
						android:inputType="textMultiLine|textCapSentences"/>

				</FrameLayout>

				<RelativeLayout
					android:id="@+id/poll_wrap"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:clipChildren="false"
					android:clipToPadding="false"
					android:paddingBottom="16dp"
					android:visibility="gone"
					tools:visibility="visible">
					<LinearLayout
						android:id="@+id/poll_settings"
						android:layout_width="match_parent"
						android:layout_height="48dp"
						android:layout_marginTop="12dp"
						android:layout_marginLeft="16dp"
						android:layout_marginRight="16dp"
						android:layout_below="@id/poll_options"
						android:gravity="center_vertical"
						android:divider="@drawable/divider_vertical_variant_1dp"
						android:showDividers="middle"
						android:dividerPadding="8dp">

						<ImageButton
							android:id="@+id/add_poll_option"
							android:layout_width="40dp"
							android:layout_height="40dp"
							android:layout_marginStart="4dp"
							android:layout_marginEnd="20dp"
							android:src="@drawable/ic_fluent_add_24_filled"
							android:tint="@color/button_text_m3_tonal"
							android:background="@drawable/bg_button_m3_tonal"
							android:contentDescription="@string/add_poll_option"/>

						<ImageView
							android:id="@+id/delete_poll_option"
							android:layout_width="40dp"
							android:layout_height="40dp"
							android:layout_marginStart="4dp"
							android:layout_marginEnd="20dp"
							android:src="@drawable/ic_fluent_delete_24_regular"
							android:scaleType="center"
							android:tint="?colorM3Error"
							android:background="@drawable/bg_button_m3_tonal_error"
							android:visibility="gone"
							tools:visibility="visible"
							android:contentDescription="@string/delete_poll_option"/>

						<LinearLayout
							android:id="@+id/poll_duration"
							android:layout_width="wrap_content"
							android:layout_height="match_parent"
							android:layout_marginHorizontal="8dp"
							android:orientation="vertical"
							android:paddingHorizontal="8dp"
							android:gravity="center_vertical"
							android:background="@drawable/bg_rect_4dp_ripple">
							
							<TextView
								android:layout_width="wrap_content"
								android:layout_height="16dp"
								android:textAppearance="@style/m3_label_small"
								android:textColor="?colorM3Secondary"
								android:gravity="center_vertical"
								android:singleLine="true"
								android:ellipsize="end"
								android:text="@string/poll_length"/>
							
							<TextView
								android:id="@+id/poll_duration_value"
								android:layout_width="wrap_content"
								android:layout_height="20dp"
								android:layout_marginTop="2dp"
								android:gravity="center_vertical"
								android:textAppearance="@style/m3_label_large"
								android:textColor="?colorM3Primary"
								android:singleLine="true"
								android:ellipsize="end"
								tools:text="1 day"/>
							
						</LinearLayout>

						<LinearLayout
							android:id="@+id/poll_style"
							android:layout_width="wrap_content"
							android:layout_height="match_parent"
							android:layout_marginHorizontal="8dp"
							android:orientation="vertical"
							android:paddingHorizontal="8dp"
							android:gravity="center_vertical"
							android:background="@drawable/bg_rect_4dp_ripple">

							<TextView
								android:layout_width="wrap_content"
								android:layout_height="16dp"
								android:textAppearance="@style/m3_label_small"
								android:textColor="?colorM3Secondary"
								android:gravity="center_vertical"
								android:singleLine="true"
								android:ellipsize="end"
								android:text="@string/poll_style"/>

							<TextView
								android:id="@+id/poll_style_value"
								android:layout_width="wrap_content"
								android:layout_height="20dp"
								android:layout_marginTop="2dp"
								android:gravity="center_vertical"
								android:textAppearance="@style/m3_label_large"
								android:textColor="?colorM3Primary"
								android:singleLine="true"
								android:ellipsize="end"
								tools:text="Pick one"/>

						</LinearLayout>

					</LinearLayout>
					<org.joinmastodon.android.ui.views.ReorderableLinearLayout
						android:id="@+id/poll_options"
						android:layout_width="match_parent"
						android:layout_height="wrap_content"
						android:layout_alignParentTop="true"
						android:layout_marginHorizontal="16dp"
						android:showDividers="middle"
						android:orientation="vertical"/>
					<View
						android:id="@+id/poll_poof"
						android:layout_width="40dp"
						android:layout_height="40dp"
						android:layout_alignTop="@id/poll_settings"
						android:layout_alignStart="@id/poll_settings"
						android:layout_marginStart="4dp"
						android:layout_marginTop="4dp"
						android:visibility="invisible"
						tools:visibility="visible"
						android:background="@drawable/poof"/>
				</RelativeLayout>

				<org.joinmastodon.android.ui.views.HorizontalScrollViewThatRespectsMatchParent
					android:id="@+id/attachments_scroller"
					android:layout_width="match_parent"
					android:layout_height="wrap_content"
					android:fillViewport="true"
					android:scrollbars="none"
					android:clipChildren="false"
					android:visibility="gone">
					<org.joinmastodon.android.ui.views.ReorderableLinearLayout
						android:id="@+id/attachments"
						android:layout_width="wrap_content"
						android:layout_height="300dp"
						android:orientation="horizontal"
						android:showDividers="middle"
						android:clipToPadding="false"
						android:paddingHorizontal="16dp"/>
				</org.joinmastodon.android.ui.views.HorizontalScrollViewThatRespectsMatchParent>

				<Button
					style="@style/Widget.Mastodon.M3.Button.Tonal.Icon"
					android:background="@drawable/bg_button_m3_tonal_selector"
					android:id="@+id/sensitive_item"
					android:orientation="horizontal"
					android:layout_width="wrap_content"
					android:layout_height="wrap_content"
					android:layout_marginBottom="16dp"
					android:layout_marginTop="8dp"
					android:layout_marginHorizontal="16dp"
					android:gravity="center_vertical"
					android:layoutDirection="locale"
					android:drawableStart="@drawable/ic_fluent_flag_18_selector"
					android:text="@string/sk_mark_media_as_sensitive"
					android:visibility="gone" />
			</LinearLayout>
		</LinearLayout>
	</ScrollView>

	<LinearLayout
		android:id="@+id/schedule_draft_view"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:layout_marginStart="12dp"
		android:gravity="center_vertical"
		android:visibility="gone"
		android:minHeight="48dp"
		android:paddingVertical="6dp">

		<org.joinmastodon.android.ui.views.AutoOrientationLinearLayout
			android:layout_width="0dp"
			android:layout_weight="1"
			android:layout_height="wrap_content">

			<TextView
				android:id="@+id/schedule_draft_text"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_marginHorizontal="6dp"
				android:layout_marginVertical="2dp"
				android:ellipsize="end"
				android:drawableStart="@drawable/ic_fluent_drafts_20_regular"
				android:drawableTint="?android:textColorSecondary"
				android:drawablePadding="16dp"
				android:text="@string/sk_compose_draft" />

			<Button
				android:id="@+id/scheduled_time_btn"
				style="@style/Widget.Mastodon.M3.Button.Outlined.Icon"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_marginStart="6dp"
				android:layout_marginVertical="2dp"
				android:gravity="center"
				android:textSize="14sp"
				android:textColor="?android:textColorSecondary"
				android:fontFamily="sans-serif"
				android:drawableStart="@drawable/ic_fluent_clock_20_regular"
				android:drawableTint="?android:textColorSecondary"
				tools:text="Dec 12, 2021, 12:42 PM"/>

		</org.joinmastodon.android.ui.views.AutoOrientationLinearLayout>

		<ImageButton
			android:id="@+id/schedule_draft_dismiss"
			android:layout_width="48dp"
			android:layout_height="48dp"
			android:layout_marginHorizontal="8dp"
			android:src="@drawable/ic_fluent_dismiss_20_filled"
			android:background="@drawable/bg_icon_button"
			android:tooltipText="@string/sk_compose_no_schedule"
			android:contentDescription="@string/sk_compose_no_schedule" />

	</LinearLayout>

	<LinearLayout
		android:id="@+id/bottom_bar"
		android:layout_width="match_parent"
		android:layout_height="56dp"
		android:elevation="3dp"
		android:outlineProvider="bounds"
		android:gravity="bottom"
		android:orientation="vertical">

		<View
			android:id="@+id/bottom_bar_autocomplete_divider"
			android:layout_width="match_parent"
			android:layout_height="1dp"
			android:layout_marginBottom="4dp"
			android:visibility="invisible"
			android:background="?colorM3Outline"/>

		<LinearLayout
			android:layout_width="match_parent"
			android:layout_height="48dp"
			android:orientation="horizontal"
			android:layout_marginStart="4dp"
			android:layout_marginVertical="4dp"
			android:gravity="center_vertical"
			android:layoutDirection="locale">

			<ImageButton
				android:id="@+id/btn_media"
				android:layout_width="40dp"
				android:layout_height="48dp"
				android:background="@drawable/bg_icon_button"
				android:padding="0px"
				android:contentDescription="@string/add_media"
				android:tooltipText="@string/add_media"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:src="@drawable/ic_fluent_image_add_24_regular"/>

			<ImageButton
				android:id="@+id/btn_poll"
				android:layout_width="40dp"
				android:layout_height="48dp"
				android:background="@drawable/bg_icon_button"
				android:padding="0px"
				android:contentDescription="@string/add_poll"
				android:tooltipText="@string/add_poll"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:src="@drawable/ic_fluent_poll_24_selector"/>

			<ImageButton
				android:id="@+id/btn_emoji"
				android:layout_width="40dp"
				android:layout_height="48dp"
				android:background="@drawable/bg_icon_button"
				android:padding="0px"
				android:contentDescription="@string/emoji"
				android:tooltipText="@string/emoji"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:src="@drawable/ic_fluent_emoji_24_selector"/>

			<ImageButton
				android:id="@+id/btn_spoiler"
				android:layout_width="40dp"
				android:layout_height="48dp"
				android:background="@drawable/bg_icon_button"
				android:padding="0px"
				android:contentDescription="@string/content_warning"
				android:tooltipText="@string/content_warning"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:src="@drawable/ic_fluent_chat_warning_24_selector"/>

			<ImageButton
				android:id="@+id/btn_content_type"
				android:layout_width="40dp"
				android:layout_height="48dp"
				android:background="@drawable/bg_icon_button"
				android:padding="0px"
				android:contentDescription="@string/sk_content_type"
				android:tooltipText="@string/sk_content_type"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:src="@drawable/ic_fluent_text_edit_style_24_selector"/>

			<ImageButton
				android:id="@+id/drafts_btn"
				android:layout_width="40dp"
				android:layout_height="48dp"
				android:padding="0px"
				android:layout_marginEnd="6dp"
				android:drawableStart="@drawable/ic_fluent_clock_24_regular"
				android:drawableTint="@color/compose_button"
				android:textColor="?android:textColorSecondary"
				android:background="@drawable/bg_icon_button"
				android:visibility="gone"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:contentDescription="@string/sk_schedule_or_draft"
				android:tooltipText="@string/sk_schedule_or_draft" />

			<Space
				android:layout_width="0px"
				android:layout_height="1px"
				android:layout_weight="1"/>

			<ImageButton
				android:id="@+id/btn_more"
				android:layout_width="24dp"
				android:layout_height="24dp"
				android:layout_marginEnd="24dp"
				android:background="?android:attr/selectableItemBackgroundBorderless"
				android:padding="0px"
				android:tint="@color/action_bar_icons"
				android:tintMode="src_in"
				android:contentDescription="@string/more_options"
				android:tooltipText="@string/more_options"
				android:visibility="gone"
				android:src="@drawable/ic_fluent_more_vertical_24_regular"/>

			<TextView
				android:id="@+id/char_counter"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_marginEnd="16dp"
				android:textAppearance="@style/m3_label_large"
				android:textColor="?colorM3OnSurface"
				android:visibility="gone"
				tools:text="500"/>

			<ImageButton
				android:id="@+id/publish"
				style="@style/Widget.Mastodon.M3.Button.Filled"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_marginEnd="8dp"
				android:minHeight="48dp"
				android:minWidth="56dp"
				android:paddingStart="16dp"
				android:paddingEnd="16dp"
				android:drawablePadding="0dp"
				android:tooltipText="@string/publish"
				android:contentDescription="@string/publish"
				android:tint="@color/compose_button"
				android:tintMode="src_in"
				android:src="@drawable/ic_fluent_send_24_regular"
				android:visibility="gone"
				android:singleLine="true" />

		</LinearLayout>
	</LinearLayout>

</org.joinmastodon.android.ui.views.SizeListenerLinearLayout>