<?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"
    android:animateLayoutChanges="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    <LinearLayout
        android:id="@+id/search_input_parent"
        android:paddingHorizontal="8dp"
        android:paddingVertical="4dp"
        android:background="@drawable/search_background"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/search_cancel"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:minHeight="40dp"
        android:orientation="horizontal">
        <ImageView
            android:layout_gravity="center_vertical"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:src="@drawable/ic_baseline_search_24"
            android:scaleType="centerInside"
            app:tint="?searchIconColor"
            android:contentDescription="@string/SearchToolbar_search" />
        <EditText
            android:hint="@string/global_search_messages"
            android:imeOptions="actionSearch"
            android:id="@+id/search_input"
            android:paddingHorizontal="@dimen/small_spacing"
            android:textSize="16sp"
            android:background="@null"
            android:layout_weight="1"
            android:layout_width="0dp"
            android:inputType="text"
            android:textColorHint="?searchHintColor"
            android:textColor="?searchTextColor"
            android:layout_height="wrap_content"/>
        <ImageView
            android:id="@+id/search_clear"
            android:background="?selectableItemBackgroundBorderless"
            android:src="@drawable/ic_close_white_18dp"
            android:layout_gravity="center_vertical"
            android:layout_width="20dp"
            android:layout_height="20dp"
            app:tint="?searchIconColor" />
    </LinearLayout>
    <Button
        style="@style/Widget.Session.Button.Common.Borderless"
        android:layout_marginStart="@dimen/small_spacing"
        android:layout_centerVertical="true"
        android:text="@string/cancel"
        app:layout_constraintStart_toEndOf="@+id/search_input_parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        android:id="@+id/search_cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>
</androidx.constraintlayout.widget.ConstraintLayout>