<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="?android:windowBackground">

  <org.thoughtcrime.securesms.util.views.DarkOverflowToolbar
      android:id="@+id/toolbar"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:background="@null"
      android:minHeight="?attr/actionBarSize"
      android:theme="?attr/actionBarStyle"
      android:visibility="gone"
      app:layout_constraintTop_toTopOf="parent"
      tools:visibility="visible">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">

      <org.thoughtcrime.securesms.components.AvatarImageView
          android:id="@+id/toolbar_icon"
          android:layout_width="58dp"
          android:layout_height="48dp"
          android:layout_alignParentStart="true"
          android:contentDescription="@string/conversation_list_settings_shortcut"
          android:paddingStart="12dp"
          android:paddingTop="10dp"
          android:paddingEnd="18dp"
          android:paddingBottom="10dp"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintStart_toStartOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          tools:src="@drawable/ic_contact_picture" />

      <TextView
          android:layout_width="0dp"
          android:layout_height="wrap_content"
          android:layout_marginStart="6dp"
          android:text="@string/app_name"
          android:textAlignment="viewStart"
          android:textColor="@color/signal_text_primary"
          android:textSize="20sp"
          android:textStyle="bold"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toStartOf="@id/search_action"
          app:layout_constraintStart_toEndOf="@id/toolbar_icon"
          app:layout_constraintTop_toTopOf="parent" />

      <androidx.appcompat.widget.AppCompatImageView
          android:id="@+id/search_action"
          android:layout_width="48dp"
          android:layout_height="48dp"
          android:background="?actionBarItemBackground"
          android:contentDescription="@string/conversation_list_search_description"
          android:padding="12dp"
          android:tint="@color/signal_icon_tint_primary"
          app:layout_constraintBottom_toBottomOf="parent"
          app:layout_constraintEnd_toEndOf="parent"
          app:layout_constraintTop_toTopOf="parent"
          app:srcCompat="@drawable/ic_search_24" />

    </androidx.constraintlayout.widget.ConstraintLayout>

  </org.thoughtcrime.securesms.util.views.DarkOverflowToolbar>

  <ViewStub
      android:id="@+id/toolbar_basic"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:layout="@layout/conversation_list_archive_toolbar"
      android:minHeight="?attr/actionBarSize"
      app:layout_constraintTop_toTopOf="parent" />

  <ViewStub
      android:id="@+id/search_toolbar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout="@layout/conversation_list_search_toolbar"
      app:layout_constraintTop_toTopOf="parent" />

  <androidx.constraintlayout.widget.Barrier
      android:id="@+id/toolbar_barrier"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:barrierDirection="bottom"
      app:constraint_referenced_ids="toolbar,toolbar_basic" />

  <View
      android:id="@+id/conversation_list_toolbar_shadow"
      android:layout_width="match_parent"
      android:layout_height="4dp"
      android:background="@drawable/toolbar_shadow"
      android:visibility="gone"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@id/toolbar_barrier"
      tools:visibility="visible" />

  <TextView
      android:id="@+id/search_no_results"
      android:layout_width="0dp"
      android:layout_height="0dp"
      android:background="@color/signal_background_primary"
      android:gravity="center"
      android:visibility="gone"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@id/toolbar_barrier"
      tools:text="@string/SearchFragment_no_results" />

  <ViewStub
      android:id="@+id/empty_state"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout="@layout/conversation_list_empty_state"
      android:layout_marginTop="32dp"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toBottomOf="@id/toolbar_barrier" />

  <ViewStub
      android:id="@+id/reminder"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout="@layout/conversation_list_reminder_view"
      app:layout_constraintTop_toBottomOf="@id/toolbar_barrier" />

  <androidx.recyclerview.widget.RecyclerView
      android:id="@+id/list"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:clipToPadding="false"
      android:nextFocusDown="@+id/fab"
      android:nextFocusForward="@+id/fab"
      android:paddingBottom="150dp"
      android:scrollbars="vertical"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintTop_toBottomOf="@id/reminder"
      tools:listitem="@layout/conversation_list_item_view"
      tools:visibility="gone" />

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

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="bottom|end"
        android:gravity="end"
        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_marginBottom="20dp"
          android:layout_marginEnd="16dp"
          android:contentDescription="@string/conversation_list_fragment__open_camera_description"
          android:focusable="true"
          android:tint="@color/signal_icon_tint_secondary"
          app:backgroundTint="@color/conversation_list_camera_button_background"
          app:srcCompat="@drawable/ic_camera_solid_white_24" />

      <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:tint="@color/core_white"
          app:srcCompat="@drawable/ic_compose_solid_24"
          app:backgroundTint="@color/core_ultramarine"/>

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

    </LinearLayout>

  </androidx.coordinatorlayout.widget.CoordinatorLayout>

</androidx.constraintlayout.widget.ConstraintLayout>
