<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:focusable="false"
    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/contentView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <androidx.appcompat.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?colorPrimary"
        app:contentInsetStart="0dp">

        <org.thoughtcrime.securesms.conversation.ConversationActionBarView
            android:id="@+id/toolbarContent"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    </androidx.appcompat.widget.Toolbar>

    <!--
    Add this to the below recycler view if you need to debug activity `adjustResize` issues:
    android:background="@drawable/cross"
    -->
    <org.thoughtcrime.securesms.conversation.v2.ConversationRecyclerView
        android:focusable="false"
        android:id="@+id/conversationRecyclerView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/typingIndicatorViewContainer"
        android:layout_below="@id/toolbar" />


    <org.thoughtcrime.securesms.conversation.v2.components.TypingIndicatorViewContainer
        android:focusable="false"
        android:id="@+id/typingIndicatorViewContainer"
        android:layout_width="match_parent"
        android:layout_height="36dp"
        android:visibility="gone"
        android:layout_above="@+id/textSendAfterApproval"
        />

    <org.thoughtcrime.securesms.conversation.v2.input_bar.InputBar
        android:id="@+id/inputBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />

    <org.thoughtcrime.securesms.conversation.v2.search.SearchBottomBar
        android:id="@+id/searchBottomBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:visibility="gone"/>

    <FrameLayout
        android:focusable="false"
        android:id="@+id/reactions_shade"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/reactions_screen_light_shade_color"
        android:foreground="@color/reactions_screen_dark_shade_color"
        android:visibility="gone"/>

    <ViewStub
        android:focusable="false"
        android:id="@+id/conversation_reaction_scrubber_stub"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:inflatedId="@+id/conversation_reaction_scrubber"
        android:layout="@layout/conversation_reaction_scrubber"/>

    <FrameLayout
        android:id="@+id/additionalContentContainer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignBottom="@+id/conversationRecyclerView"/>

    <LinearLayout
        android:id="@+id/attachmentOptionsContainer"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="@dimen/small_spacing"
        android:elevation="8dp"
        android:layout_alignParentStart="true"
        android:layout_alignParentBottom="true"
        android:layout_marginBottom="60dp"
        android:orientation="vertical">

        <RelativeLayout
            android:id="@+id/gifButtonContainer"
            android:layout_width="@dimen/input_bar_button_expanded_size"
            android:layout_height="@dimen/input_bar_button_expanded_size"
            android:contentDescription="@string/AccessibilityId_gif_button"
            android:alpha="0" />

        <RelativeLayout
            android:id="@+id/documentButtonContainer"
            android:layout_marginTop="8dp"
            android:layout_width="@dimen/input_bar_button_expanded_size"
            android:layout_height="@dimen/input_bar_button_expanded_size"
            android:contentDescription="@string/AccessibilityId_documents_folder"
            android:alpha="0" />

        <RelativeLayout
            android:id="@+id/libraryButtonContainer"
            android:layout_marginTop="8dp"
            android:layout_width="@dimen/input_bar_button_expanded_size"
            android:layout_height="@dimen/input_bar_button_expanded_size"
            android:contentDescription="@string/AccessibilityId_images_folder"
            android:alpha="0" />

        <RelativeLayout
            android:id="@+id/cameraButtonContainer"
            android:layout_marginTop="8dp"
            android:layout_width="@dimen/input_bar_button_expanded_size"
            android:layout_height="@dimen/input_bar_button_expanded_size"
            android:contentDescription="@string/AccessibilityId_select_camera_button"
            android:alpha="0" />

    </LinearLayout>

    <TextView
        android:id="@+id/textSendAfterApproval"
        android:text="@string/ConversationActivity_send_after_approval"
        android:visibility="gone"
        android:textAlignment="center"
        android:textColor="@color/classic_light_2"
        android:padding="22dp"
        android:textSize="12sp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignWithParentIfMissing="true"
        android:layout_above="@id/messageRequestBar"/>

    <RelativeLayout
        android:id="@+id/scrollToBottomButton"
        android:visibility="gone"
        android:layout_width="40dp"
        android:layout_height="50dp"
        android:layout_alignParentEnd="true"
        android:layout_above="@+id/messageRequestBar"
        android:layout_alignWithParentIfMissing="true"
        android:layout_marginEnd="12dp"
        android:layout_marginBottom="32dp">

        <RelativeLayout
            android:layout_width="40dp"
            android:layout_height="40dp"
            android:layout_alignParentBottom="true"
            android:layout_centerHorizontal="true"
            android:background="@drawable/view_scroll_to_bottom_button_background">

            <ImageView
                android:layout_width="16dp"
                android:layout_height="16dp"
                android:layout_centerInParent="true"
                android:rotation="180"
                android:src="@drawable/ic_chevron_up"
                app:tint="?android:textColorPrimary" />

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/unreadCountIndicator"
            android:layout_width="wrap_content"
            android:maxWidth="40dp"
            android:paddingLeft="4dp"
            android:paddingRight="4dp"
            android:layout_height="20dp"
            android:layout_centerHorizontal="true"
            android:layout_alignParentTop="true"
            android:background="@drawable/rounded_rectangle"
            android:backgroundTint="?conversation_unread_count_indicator_background">

            <TextView
                android:id="@+id/unreadCountTextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:textSize="@dimen/very_small_font_size"
                android:textColor="?android:textColorPrimary"
                android:text="8" />

        </RelativeLayout>

    </RelativeLayout>

    <org.thoughtcrime.securesms.conversation.v2.input_bar.InputBarRecordingView
        android:id="@+id/inputBarRecordingView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginBottom="-12dp"
        android:visibility="gone"
        android:layout_alignParentBottom="true" />

    <RelativeLayout
        android:id="@+id/blockedBanner"
        android:contentDescription="@string/AccessibilityId_blocked_banner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:background="@color/destructive"
        android:visibility="gone"
        tools:visibility="visible">

        <TextView
            android:id="@+id/blockedBannerTextView"
            android:contentDescription="@string/AccessibilityId_blocked_banner_text"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:layout_margin="@dimen/medium_spacing"
            android:textColor="@color/white"
            android:textSize="@dimen/small_font_size"
            android:textStyle="bold"
            tools:text="Elon is blocked. Unblock them?" />

    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/outdatedBanner"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/blockedBanner"
        android:background="@color/outdated_client_banner_background_color"
        android:visibility="gone"
        tools:visibility="visible">

        <TextView
            android:id="@+id/outdatedBannerTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:layout_centerInParent="true"
            android:layout_marginVertical="@dimen/very_small_spacing"
            android:layout_marginHorizontal="@dimen/medium_spacing"
            android:textColor="@color/black"
            android:textSize="@dimen/tiny_font_size"
            tools:text="This user's client is outdated, things may not work as expected" />

    </RelativeLayout>

    <TextView
        android:padding="@dimen/medium_spacing"
        android:textSize="@dimen/small_font_size"
        android:textColor="?android:textColorSecondary"
        android:textAlignment="center"
        android:id="@+id/placeholderText"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/blockedBanner"
        android:elevation="8dp"
        tools:text="@string/activity_conversation_empty_state_default"
        />

    <LinearLayout
        android:id="@+id/messageRequestBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_above="@id/inputBar"
        android:layout_marginBottom="@dimen/large_spacing"
        android:orientation="vertical"
        android:visibility="gone"
        tools:visibility="visible">

        <TextView
            android:id="@+id/messageRequestBlock"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:contentDescription="@string/AccessibilityId_block_message_request_button"
            android:textColor="@color/destructive"
            android:paddingHorizontal="@dimen/massive_spacing"
            android:paddingVertical="@dimen/small_spacing"
            android:textSize="@dimen/text_size"
            android:text="@string/activity_conversation_block_user"/>

        <TextView
            android:id="@+id/sendAcceptsTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/medium_spacing"
            android:alpha="0.6"
            android:gravity="center_horizontal"
            android:text="@string/message_requests_send_notice"
            android:textColor="?android:textColorPrimary"
            android:textSize="@dimen/small_font_size" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginHorizontal="@dimen/medium_spacing"
            android:orientation="horizontal">

            <Button
                android:id="@+id/acceptMessageRequestButton"
                style="@style/Widget.Session.Button.Common.ProminentOutline"
                android:contentDescription="@string/AccessibilityId_accept_message_request_button"
                android:layout_width="0dp"
                android:layout_height="@dimen/medium_button_height"
                android:layout_weight="1"
                android:text="@string/accept" />

            <Button
                android:id="@+id/declineMessageRequestButton"
                style="@style/Widget.Session.Button.Common.DestructiveOutline"
                android:contentDescription="@string/AccessibilityId_decline_message_request_button"
                android:layout_width="0dp"
                android:layout_height="@dimen/medium_button_height"
                android:layout_marginStart="@dimen/medium_spacing"
                android:layout_weight="1"
                android:text="@string/decline" />

        </LinearLayout>

    </LinearLayout>

</RelativeLayout>
