1<?xml version="1.0" encoding="utf-8"?>
2<!-- Copyright (C) 2016 The Android Open Source Project
3
4     Licensed under the Apache License, Version 2.0 (the "License");
5     you may not use this file except in compliance with the License.
6     You may obtain a copy of the License at
7
8          http://www.apache.org/licenses/LICENSE-2.0
9
10     Unless required by applicable law or agreed to in writing, software
11     distributed under the License is distributed on an "AS IS" BASIS,
12     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13     See the License for the specific language governing permissions and
14     limitations under the License.
15-->
16<LinearLayout
17    xmlns:android="http://schemas.android.com/apk/res/android"
18    xmlns:app="http://schemas.android.com/apk/res-auto"
19    android:id="@+id/search_panel"
20    android:layout_width="match_parent"
21    android:layout_height="match_parent"
22    android:orientation="vertical">
23
24    <FrameLayout
25        android:id="@+id/search_bar_container"
26        android:layout_width="match_parent"
27        android:layout_height="wrap_content"
28        android:background="@color/search_panel_background"
29        android:elevation="4dp">
30        <androidx.cardview.widget.CardView
31            android:id="@+id/search_bar"
32            android:layout_width="match_parent"
33            android:layout_height="wrap_content"
34            android:layout_margin="@dimen/search_bar_margin"
35            app:cardCornerRadius="2dp"
36            app:cardBackgroundColor="?android:attr/colorBackground"
37            app:cardElevation="2dp">
38            <Toolbar
39                android:id="@+id/search_toolbar"
40                android:layout_width="match_parent"
41                android:layout_height="@dimen/search_bar_height"
42                android:background="?android:attr/selectableItemBackground"
43                android:contentInsetStart="0dp"
44                android:contentInsetStartWithNavigation="0dp"
45                android:theme="?android:attr/actionBarTheme">
46                <SearchView
47                    android:id="@+id/search_view"
48                    android:layout_width="match_parent"
49                    android:layout_height="match_parent"
50                    android:iconifiedByDefault="false"
51                    android:imeOptions="actionSearch|flagNoExtractUi"
52                    android:searchIcon="@null"/>
53            </Toolbar>
54        </androidx.cardview.widget.CardView>
55    </FrameLayout>
56
57    <FrameLayout
58        android:id="@+id/layout_results"
59        android:layout_width="match_parent"
60        android:layout_height="0dp"
61        android:layout_weight="1"
62        android:orientation="vertical">
63
64        <!-- Padding is included in the background -->
65        <androidx.recyclerview.widget.RecyclerView
66            android:id="@+id/list_results"
67            android:layout_width="match_parent"
68            android:layout_height="wrap_content"
69            android:paddingStart="@dimen/dashboard_padding_start"
70            android:paddingEnd="@dimen/dashboard_padding_end"
71            android:paddingTop="@dimen/dashboard_padding_top"
72            android:paddingBottom="@dimen/dashboard_padding_bottom"
73            android:scrollbarStyle="outsideOverlay"
74            android:scrollbars="vertical"/>
75
76        <LinearLayout
77            android:id="@+id/no_results_layout"
78            android:layout_width="match_parent"
79            android:layout_height="match_parent"
80            android:paddingTop="35dp"
81            android:orientation="vertical"
82            android:visibility="gone">
83
84            <Space
85                android:layout_width="match_parent"
86                android:layout_height="?android:attr/actionBarSize"/>
87
88            <ImageView
89                android:layout_height="wrap_content"
90                android:layout_width="wrap_content"
91                android:layout_gravity="center_horizontal"
92                android:src="@drawable/empty_search_results"/>
93
94            <TextView
95                android:layout_height="wrap_content"
96                android:layout_width="match_parent"
97                android:paddingTop="24dp"
98                android:textSize="18sp"
99                android:text="@string/search_no_results"
100                android:gravity="center"/>
101
102        </LinearLayout>
103
104    </FrameLayout>
105
106    <include layout="@layout/search_feedback"/>
107
108</LinearLayout>