<?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"
    tools:viewBindingIgnore="true"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/container"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.swiperefreshlayout.widget.SwipeRefreshLayout
        android:id="@+id/swipe_refresh"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/chipRecycler">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recycler_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:clipToPadding="false"
            android:scrollbarThumbVertical="@drawable/contact_selection_scrollbar_thumb"
            android:scrollbars="vertical"
            tools:listitem="@layout/contact_selection_list_item" />

        <TextView
            android:id="@android:id/empty"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="15dp"
            android:gravity="center|center_vertical"
            android:text="@string/contact_selection_group_activity__finding_contacts"
            android:textSize="20sp" />

    </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

    <org.thoughtcrime.securesms.components.RecyclerViewFastScroller
        android:id="@+id/fast_scroller"
        android:layout_width="wrap_content"
        android:layout_height="0dp"
        android:layout_gravity="end"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/chipRecycler"
        tools:visibility="visible" />

    <LinearLayout
        android:id="@+id/show_contacts_container"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_gravity="center"
        android:orientation="vertical"
        android:visibility="gone"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/chipRecycler"
        tools:visibility="visible">

        <com.google.android.material.button.MaterialButton
            android:id="@+id/show_contacts_button"
            style="@style/Signal.Widget.Button.Large.Primary"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="20dp"
            android:background="@color/core_ultramarine"
            android:padding="10dp"
            android:text="@string/contact_selection_list_fragment__show_contacts"
            android:textColor="@color/white" />

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <com.pnikosis.materialishprogress.ProgressWheel
                android:id="@+id/progress"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="invisible"
                app:matProg_barColor="@color/core_ultramarine_dark"
                app:matProg_barWidth="6dp"
                app:matProg_circleRadius="145dp"
                app:matProg_progressIndeterminate="true"
                app:matProg_rimColor="@color/core_ultramarine"
                tools:visibility="visible" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:importantForAccessibility="no"
                android:src="@drawable/no_contacts" />

        </FrameLayout>

        <TextView
            android:id="@+id/show_contacts_description"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="50dp"
            android:layout_marginTop="20dp"
            android:layout_marginEnd="50dp"
            android:gravity="center"
            android:lineSpacingMultiplier="1.3"
            android:text="@string/contact_selection_list_fragment__signal_needs_access_to_your_contacts_in_order_to_display_them"
            android:textSize="15sp" />

    </LinearLayout>

    <com.google.android.material.button.MaterialButton
        android:id="@+id/header_action"
        style="@style/Widget.Signal.Button.Small"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_marginEnd="16dp"
        android:ellipsize="end"
        android:fontFamily="sans-serif-medium"
        android:maxLines="1"
        android:textColor="@color/signal_text_primary"
        android:visibility="gone"
        app:backgroundTint="@color/signal_colorSurface1"
        app:iconTint="@color/signal_colorOnSurfaceVariant"
        app:layout_constraintEnd_toEndOf="@id/swipe_refresh"
        app:layout_constraintTop_toTopOf="@id/swipe_refresh"
        tools:text="@string/ContactsCursorLoader_new_story"
        tools:visibility="visible" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/chipRecycler"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:minHeight="48sp"
        android:orientation="horizontal"
        android:paddingStart="@dimen/dsl_settings_gutter"
        android:paddingEnd="@dimen/dsl_settings_gutter"
        android:scrollbars="none"
        android:visibility="gone"
        android:background="@color/signal_colorSurface"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        app:layout_constraintTop_toTopOf="parent"
        tools:listitem="@layout/contact_selection_list_chip"
        tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>