<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <androidx.core.widget.NestedScrollView
        android:id="@+id/search_result_nested_scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/searchbar_scrolling_view_behavior">

        <!-- Search result -->
        <LinearLayout
            android:id="@+id/search_result_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingTop="64dp"
            android:paddingBottom="@dimen/global_padding_bottom">

            <!--  Artist  -->
            <LinearLayout
                android:id="@+id/search_artist_sector"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingBottom="8dp"
                android:visibility="gone">

                <TextView
                    style="@style/TitleLarge"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingStart="16dp"
                    android:paddingTop="20dp"
                    android:paddingEnd="16dp"
                    android:text="@string/search_title_artist" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/search_result_artist_recycler_view"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:clipToPadding="false"
                    android:paddingStart="16dp"
                    android:paddingTop="8dp"
                    android:paddingEnd="8dp"
                    android:paddingBottom="8dp" />
            </LinearLayout>

            <!--  Album  -->
            <LinearLayout
                android:id="@+id/search_album_sector"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingBottom="8dp"
                android:visibility="gone">

                <TextView
                    style="@style/TitleLarge"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingStart="16dp"
                    android:paddingTop="20dp"
                    android:paddingEnd="16dp"
                    android:text="@string/search_title_album" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/search_result_album_recycler_view"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:clipToPadding="false"
                    android:paddingStart="16dp"
                    android:paddingTop="8dp"
                    android:paddingEnd="8dp"
                    android:paddingBottom="8dp" />
            </LinearLayout>

            <!--  Songs  -->
            <LinearLayout
                android:id="@+id/search_song_sector"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                android:paddingBottom="8dp"
                android:visibility="gone">

                <TextView
                    style="@style/TitleLarge"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingStart="16dp"
                    android:paddingTop="20dp"
                    android:paddingEnd="16dp"
                    android:text="@string/search_title_song" />

                <androidx.recyclerview.widget.RecyclerView
                    android:id="@+id/search_result_tracks_recycler_view"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginTop="8dp"
                    android:layout_marginBottom="8dp"
                    android:clipToPadding="false"
                    android:paddingTop="8dp"
                    android:paddingBottom="8dp" />
            </LinearLayout>
        </LinearLayout>
    </androidx.core.widget.NestedScrollView>

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <com.google.android.material.search.SearchBar
            android:id="@+id/search_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:hint="@string/search_hint">

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

    <com.google.android.material.search.SearchView
        android:id="@+id/search_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:hint="@string/search_hint"
        app:layout_anchor="@id/search_bar">

        <!-- Content goes here (ScrollView, RecyclerView, etc.). -->
        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:scrollbars="none"
            android:paddingBottom="@dimen/global_padding_bottom">

            <LinearLayout
                android:id="@+id/search_view_suggestion_container"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"/>
        </ScrollView>
    </com.google.android.material.search.SearchView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>