<?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"
                                                android:id="@+id/activity_parent"
                                                android:layout_width="match_parent"
                                                android:layout_height="match_parent"
                                                android:orientation="vertical">

	<include layout="@layout/toolbar_view"/>

	<RelativeLayout
		android:id="@+id/background_layout"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:layout_weight="2"
		android:visibility="invisible">

		<androidx.viewpager2.widget.ViewPager2
			android:id="@+id/view_pager"
			android:layout_width="match_parent"
			android:layout_height="match_parent" />

		<com.google.android.material.card.MaterialCardView
			style="@style/Threema.CardView.MediaViewerCaption"
			android:id="@+id/item_count_container"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_above="@+id/bottom_panel"
			android:layout_marginLeft="8dp"
			android:layout_marginRight="8dp"
			android:layout_marginBottom="8dp"
			android:layout_alignParentLeft="true"
			app:contentPaddingBottom="4dp"
			app:contentPaddingLeft="8dp"
			app:contentPaddingRight="8dp"
			app:contentPaddingTop="4dp">

			<TextView
				android:id="@+id/item_count"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_gravity="center_horizontal"
				android:textColor="@android:color/white"
				android:maxLines="1"
				android:ellipsize="end"
				android:textSize="12sp"/>

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

		<com.google.android.material.card.MaterialCardView
			style="@style/Threema.CardView.MediaViewerCaption"
			android:id="@+id/recipient_container"
			android:layout_width="wrap_content"
			android:layout_height="wrap_content"
			android:layout_above="@+id/bottom_panel"
			android:layout_marginLeft="8dp"
			android:layout_marginRight="8dp"
			android:layout_marginBottom="8dp"
			android:layout_alignParentRight="true"
			app:contentPaddingBottom="4dp"
			app:contentPaddingLeft="8dp"
			app:contentPaddingRight="8dp"
			app:contentPaddingTop="4dp">

			<ch.threema.app.emojis.EmojiTextView
				android:id="@+id/recipient_text"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:layout_gravity="center_horizontal"
				android:textColor="@android:color/white"
				android:maxLines="1"
				android:ellipsize="end"
				android:textSize="12sp"/>

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

		<FrameLayout
			android:id="@+id/bottom_panel"
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:layout_above="@+id/item_list"
			android:layout_alignWithParentIfMissing="true"
			android:paddingTop="4dp"
			android:paddingBottom="4dp"
			android:paddingLeft="8dp"
			android:paddingRight="8dp"
			android:background="#77000000"
            android:animateLayoutChanges="true">

			<ch.threema.app.ui.ComposeEditText
				android:id="@+id/caption_edittext"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:paddingBottom="4dp"
				android:paddingTop="3dp"
				android:paddingLeft="@dimen/emoji_button_width"
				android:paddingRight="45dp"
				android:layout_marginRight="56dp"
				android:layout_gravity="bottom"
				android:background="@drawable/bubble_compose_dark_outline"
				android:hint="@string/add_caption_hint"
				android:maxLength="1000"
				android:maxLines="@integer/message_edittext_max_lines"
				android:ellipsize="end"
				android:minHeight="@dimen/input_text_height"
				android:nextFocusRight="@+id/attach_button"
				android:nextFocusLeft="@+id/emoji_button"
				android:scrollHorizontally="false"
				android:textSize="16sp">
				<requestFocus />
			</ch.threema.app.ui.ComposeEditText>

			<ch.threema.app.emojis.EmojiButton
				android:id="@+id/emoji_button"
				style="?android:attr/borderlessButtonStyle"
				android:layout_width="@dimen/emoji_button_width"
				android:layout_height="@dimen/emoji_button_width"
				android:layout_marginBottom="5dp"
				android:layout_gravity="left|bottom"
				android:background="@drawable/selector_compose_button"
				android:contentDescription="@string/select_emoji"
				android:padding="8dp"
				android:drawablePadding="0dip"
				android:focusable="true"
				android:nextFocusRight="@+id/caption_edittext"/>

			<androidx.appcompat.widget.AppCompatImageButton
				android:id="@+id/camera_button"
				style="?android:attr/borderlessButtonStyle"
				android:layout_width="@dimen/emoji_button_width"
				android:layout_height="@dimen/emoji_button_width"
				android:layout_gravity="bottom|right"
				android:layout_marginBottom="4dp"
				android:layout_marginRight="59dp"
				android:background="@drawable/selector_compose_button"
				android:contentDescription="@string/take_photo"
				android:nextFocusRight="@+id/send_button"
				android:padding="8dp"
				android:drawablePadding="0dip"
				android:focusable="true"
				app:tint="@android:color/white"
				app:srcCompat="@drawable/ic_camera_outline"/>

			<ch.threema.app.ui.SendButton
				android:id="@+id/send_button"
				android:layout_width="@dimen/input_text_height"
				android:layout_height="@dimen/input_text_height"
				android:layout_gravity="bottom|right"
				android:clickable="true"
				android:focusable="true"
				android:foreground="@drawable/selector_avatar"
				app:buttonTheme="1"/>

		</FrameLayout>

		<androidx.recyclerview.widget.RecyclerView
			android:id="@+id/item_list"
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:clipChildren="false"
			android:layout_alignParentBottom="true"
			android:scrollbars="none"
			android:gravity="center"
			android:background="#77000000"/>

	</RelativeLayout>

	<ViewStub
		android:id="@+id/emoji_stub"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:inflatedId="@+id/emoji_picker"
		android:layout="@layout/emoji_picker_layout"/>

</LinearLayout>
