<?xml version="1.0" encoding="utf-8"?><!--
  ~ Copyright (c) 2018-2023 Threema GmbH
  ~ All rights reserved.
  -->

<androidx.coordinatorlayout.widget.CoordinatorLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
	android:id="@+id/parent_layout"
	android:layout_width="match_parent"
	android:layout_height="match_parent"
	android:background="?attr/background_primary">

	<LinearLayout
		android:id="@+id/initial_layout"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:orientation="vertical"
		app:layout_behavior="@string/appbar_scrolling_view_behavior">

		<androidx.constraintlayout.widget.ConstraintLayout
			android:id="@+id/search_container"
			android:layout_width="match_parent"
			android:layout_height="@dimen/directory_search_bar_height"
			android:layout_gravity="top"
			android:layout_marginTop="32dp"
			android:layout_marginBottom="32dp"
			android:layout_marginLeft="16dp"
			android:layout_marginRight="16dp"
			android:background="?attr/compose_edittext_bubble"
			android:clickable="true"
			android:focusable="true"
			android:paddingBottom="16dp"
			android:paddingLeft="16dp"
			android:paddingRight="16dp"
			android:paddingTop="16dp" >

			<ImageView
				android:id="@+id/search_image"
				android:layout_width="24dp"
				android:layout_height="24dp"
				android:clickable="false"
				android:focusable="false"
				android:src="@drawable/ic_search_outline"
				app:layout_constraintBottom_toBottomOf="parent"
				app:layout_constraintLeft_toLeftOf="parent"
				app:layout_constraintTop_toTopOf="parent"
				app:tint="?attr/textColorPrimary" />

			<TextView
				android:id="@+id/search_text"
				android:layout_width="0dp"
				android:layout_height="wrap_content"
				android:layout_marginLeft="16dp"
				android:layout_marginBottom="4dp"
				android:clickable="false"
				android:focusable="false"
				android:text="@string/directory_search"
				android:textColor="?attr/textColorSecondary"
				android:textSize="20dp"
				app:layout_constraintBottom_toBottomOf="parent"
				app:layout_constraintLeft_toRightOf="@id/search_image"
				app:layout_constraintRight_toRightOf="parent"
				app:layout_constraintTop_toTopOf="parent" />

		</androidx.constraintlayout.widget.ConstraintLayout>

		<ImageView
			android:layout_width="48dp"
			android:layout_height="48dp"
			android:layout_marginBottom="32dp"
			android:src="@drawable/ic_contacts_outline"
			app:tint="?attr/textColorSecondary"
			android:layout_gravity="center_horizontal" />

		<TextView
			android:id="@+id/explain_text"
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:textAlignment="center"
			android:gravity="center_horizontal"
			android:paddingLeft="16dp"
			android:paddingRight="16dp"
			android:text="@string/directory_explain_text"
			android:textAppearance="@style/Threema.TextAppearance.Emptyview" />

	</LinearLayout>

	<LinearLayout
		android:id="@+id/results_layout"
		android:layout_width="match_parent"
		android:layout_height="match_parent"
		android:orientation="vertical"
		android:visibility="gone"
		android:background="?android:windowBackground"
		app:layout_behavior="@string/appbar_scrolling_view_behavior">

		<HorizontalScrollView
			android:layout_width="match_parent"
			android:layout_height="wrap_content"
			android:scrollbarSize="0dp"
			android:scrollbars="none">

			<com.google.android.material.chip.ChipGroup
				android:id="@+id/chip_group"
				android:layout_width="wrap_content"
				android:layout_height="wrap_content"
				android:paddingBottom="-1dp"
				android:paddingLeft="16dp"
				android:paddingRight="16dp"
				android:paddingTop="4dp"
				android:visibility="gone"
				app:chipSpacingHorizontal="4dp"
				app:chipSpacingVertical="0dp"
				app:singleLine="true" />

		</HorizontalScrollView>

		<FrameLayout
			android:layout_width="match_parent"
			android:layout_height="match_parent"
			android:layout_marginLeft="@dimen/tablet_additional_padding_left_right"
			android:layout_marginRight="@dimen/tablet_additional_padding_left_right"
			app:layout_behavior="@string/appbar_scrolling_view_behavior">

			<TextView
				android:id="@+id/empty_text"
				android:layout_width="match_parent"
				android:layout_height="wrap_content"
				android:layout_marginTop="32dp"
				android:textAlignment="center"
				android:gravity="center_horizontal"
				android:paddingLeft="16dp"
				android:paddingRight="16dp"
				android:text=""
				android:textAppearance="@style/Threema.TextAppearance.Emptyview" />

			<ch.threema.app.ui.EmptyRecyclerView
				android:id="@+id/recycler"
				android:layout_width="match_parent"
				android:layout_height="match_parent"
				android:layout_marginTop="4dp" />

		</FrameLayout>

	</LinearLayout>

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

	<com.google.android.material.progressindicator.LinearProgressIndicator
		android:id="@+id/progress_bar"
		app:layout_behavior="@string/appbar_scrolling_view_behavior"
		android:layout_width="match_parent"
		android:layout_height="wrap_content"
		android:indeterminate="true"/>

</androidx.coordinatorlayout.widget.CoordinatorLayout>
