Fan Zhang | d0eec41 | 2017-12-06 10:02:00 -0800 | [diff] [blame] | 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" |
Danny Lin | 718ec0e | 2021-10-05 19:17:46 -0700 | [diff] [blame^] | 27 | android:layout_height="wrap_content"> |
Aravind Sreekumar | 62e1573 | 2018-04-10 12:15:45 -0700 | [diff] [blame] | 28 | <androidx.cardview.widget.CardView |
Fan Zhang | d0eec41 | 2017-12-06 10:02:00 -0800 | [diff] [blame] | 29 | android:id="@+id/search_bar" |
| 30 | android:layout_width="match_parent" |
| 31 | android:layout_height="wrap_content" |
| 32 | android:layout_margin="@dimen/search_bar_margin" |
Danny Lin | 718ec0e | 2021-10-05 19:17:46 -0700 | [diff] [blame^] | 33 | app:cardCornerRadius="@dimen/search_bar_corner_radius" |
| 34 | app:cardElevation="0dp"> |
Fan Zhang | d0eec41 | 2017-12-06 10:02:00 -0800 | [diff] [blame] | 35 | <Toolbar |
| 36 | android:id="@+id/search_toolbar" |
| 37 | android:layout_width="match_parent" |
| 38 | android:layout_height="@dimen/search_bar_height" |
Danny Lin | 718ec0e | 2021-10-05 19:17:46 -0700 | [diff] [blame^] | 39 | android:background="@drawable/search_bar_selected_background" |
Fan Zhang | d0eec41 | 2017-12-06 10:02:00 -0800 | [diff] [blame] | 40 | android:contentInsetStart="0dp" |
| 41 | android:contentInsetStartWithNavigation="0dp" |
| 42 | android:theme="?android:attr/actionBarTheme"> |
| 43 | <SearchView |
| 44 | android:id="@+id/search_view" |
| 45 | android:layout_width="match_parent" |
| 46 | android:layout_height="match_parent" |
| 47 | android:iconifiedByDefault="false" |
| 48 | android:imeOptions="actionSearch|flagNoExtractUi" |
| 49 | android:searchIcon="@null"/> |
| 50 | </Toolbar> |
Aravind Sreekumar | 62e1573 | 2018-04-10 12:15:45 -0700 | [diff] [blame] | 51 | </androidx.cardview.widget.CardView> |
Fan Zhang | d0eec41 | 2017-12-06 10:02:00 -0800 | [diff] [blame] | 52 | </FrameLayout> |
| 53 | |
| 54 | <FrameLayout |
| 55 | android:id="@+id/layout_results" |
| 56 | android:layout_width="match_parent" |
| 57 | android:layout_height="0dp" |
| 58 | android:layout_weight="1" |
| 59 | android:orientation="vertical"> |
| 60 | |
| 61 | <!-- Padding is included in the background --> |
Aravind Sreekumar | 62e1573 | 2018-04-10 12:15:45 -0700 | [diff] [blame] | 62 | <androidx.recyclerview.widget.RecyclerView |
Fan Zhang | d0eec41 | 2017-12-06 10:02:00 -0800 | [diff] [blame] | 63 | android:id="@+id/list_results" |
| 64 | android:layout_width="match_parent" |
| 65 | android:layout_height="wrap_content" |
| 66 | android:paddingStart="@dimen/dashboard_padding_start" |
| 67 | android:paddingEnd="@dimen/dashboard_padding_end" |
| 68 | android:paddingTop="@dimen/dashboard_padding_top" |
| 69 | android:paddingBottom="@dimen/dashboard_padding_bottom" |
| 70 | android:scrollbarStyle="outsideOverlay" |
| 71 | android:scrollbars="vertical"/> |
| 72 | |
| 73 | <LinearLayout |
| 74 | android:id="@+id/no_results_layout" |
| 75 | android:layout_width="match_parent" |
| 76 | android:layout_height="match_parent" |
| 77 | android:paddingTop="35dp" |
| 78 | android:orientation="vertical" |
| 79 | android:visibility="gone"> |
| 80 | |
| 81 | <Space |
| 82 | android:layout_width="match_parent" |
| 83 | android:layout_height="?android:attr/actionBarSize"/> |
| 84 | |
| 85 | <ImageView |
| 86 | android:layout_height="wrap_content" |
| 87 | android:layout_width="wrap_content" |
| 88 | android:layout_gravity="center_horizontal" |
| 89 | android:src="@drawable/empty_search_results"/> |
| 90 | |
| 91 | <TextView |
| 92 | android:layout_height="wrap_content" |
| 93 | android:layout_width="match_parent" |
| 94 | android:paddingTop="24dp" |
| 95 | android:textSize="18sp" |
| 96 | android:text="@string/search_no_results" |
| 97 | android:gravity="center"/> |
| 98 | |
| 99 | </LinearLayout> |
| 100 | |
| 101 | </FrameLayout> |
| 102 | |
| 103 | <include layout="@layout/search_feedback"/> |
| 104 | |
| 105 | </LinearLayout> |