<?xml version="1.0" encoding="utf-8"?>

<androidx.constraintlayout.widget.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:id="@+id/constraint_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?android:windowBackground"
    tools:viewBindingIgnore="true">

    <ViewStub
        android:id="@+id/voice_note_player"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inflatedId="@+id/voice_note_player"
        android:layout="@layout/voice_note_player_stub"
        app:layout_constraintTop_toTopOf="parent" />

    <ViewStub
        android:id="@+id/reminder"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inflatedId="@+id/reminder"
        android:layout="@layout/conversation_list_reminder_view"
        app:layout_constraintTop_toTopOf="parent" />

    <ViewStub
        android:id="@+id/payments_notification"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inflatedId="@+id/payments_notification"
        android:layout="@layout/payment_notification_view"
        app:layout_constraintTop_toTopOf="parent" />

    <androidx.constraintlayout.widget.Barrier
        android:id="@+id/banner_barrier"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:barrierDirection="bottom"
        app:constraint_referenced_ids="reminder,payments_notification,voice_note_player" />

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@id/banner_barrier">

        <com.google.android.material.appbar.AppBarLayout
            android:id="@+id/recycler_coordinator_app_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:expanded="false"
            app:layout_behavior="org.thoughtcrime.securesms.conversationlist.ConversationFilterBehavior">

            <org.thoughtcrime.securesms.conversationlist.ConversationListFilterPullView
                android:id="@+id/pull_view"
                android:layout_width="match_parent"
                android:layout_height="80dp"
                android:background="@color/signal_colorSurface1"
                app:layout_scrollFlags="scroll|enterAlwaysCollapsed"
                app:layout_scrollInterpolator="@android:anim/decelerate_interpolator" />

        </com.google.android.material.appbar.AppBarLayout>

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/signal_colorBackground"
            android:clipToPadding="false"
            android:nextFocusDown="@+id/fab"
            android:nextFocusForward="@+id/fab"
            android:paddingBottom="160dp"
            android:scrollbars="vertical"
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            tools:listitem="@layout/conversation_list_item_view"
            tools:visibility="visible" />
    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <androidx.coordinatorlayout.widget.CoordinatorLayout
        android:id="@+id/coordinator"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:clipChildren="false"
        android:clipToPadding="false"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@id/banner_barrier">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:clipChildren="false"
            android:clipToPadding="false"
            android:gravity="end"
            android:orientation="vertical"
            app:layout_behavior="org.thoughtcrime.securesms.util.views.SlideUpWithSnackbarBehavior">

            <org.thoughtcrime.securesms.components.registration.PulsingFloatingActionButton
                android:id="@+id/camera_fab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="16dp"
                android:layout_marginBottom="20dp"
                android:contentDescription="@string/conversation_list_fragment__open_camera_description"
                android:focusable="true"
                android:theme="@style/Widget.Material3.FloatingActionButton.Secondary"
                android:transitionName="camera_fab"
                android:visibility="gone"
                app:backgroundTint="@color/signal_colorSurfaceVariant"
                app:srcCompat="@drawable/ic_camera_outline_24"
                app:tint="@color/signal_colorOnSurface"
                tools:visibility="visible" />

            <org.thoughtcrime.securesms.components.registration.PulsingFloatingActionButton
                android:id="@+id/fab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginEnd="16dp"
                android:layout_marginBottom="16dp"
                android:contentDescription="@string/conversation_list_fragment__fab_content_description"
                android:focusable="true"
                android:theme="@style/Widget.Material3.FloatingActionButton.Secondary"
                android:transitionName="new_convo_fab"
                android:visibility="gone"
                app:backgroundTint="@color/signal_colorPrimaryContainer"
                app:srcCompat="@drawable/ic_compose_outline_24"
                app:tint="@color/signal_colorOnSurface"
                tools:visibility="visible" />

            <ViewStub
                android:id="@+id/megaphone_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout="@layout/conversation_list_megaphone_container"
                app:layout_constraintBottom_toBottomOf="parent" />

        </LinearLayout>

    </androidx.coordinatorlayout.widget.CoordinatorLayout>

    <org.thoughtcrime.securesms.components.menu.SignalBottomActionBar
        android:id="@+id/conversation_list_bottom_action_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="16dp"
        android:layout_marginBottom="16dp"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
