Android O SDK.
[android_tools.git] / sdk / platforms / android-26 / data / res / layout / search_view.xml
blob0c462fda9235bd7d4057648a18e3d02900ae7c38
1 <?xml version="1.0" encoding="utf-8"?>
2 <!--
3 /*
4  * Copyright (C) 2010 The Android Open Source Project
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
19 -->
20 <LinearLayout
21     xmlns:android="http://schemas.android.com/apk/res/android"
22     android:id="@+id/search_bar"
23     android:layout_width="match_parent"
24     android:layout_height="match_parent"
25     android:orientation="horizontal">
27     <!-- This is actually used for the badge icon *or* the badge label (or neither) -->
28     <TextView
29         android:id="@+id/search_badge"
30         android:layout_width="wrap_content"
31         android:layout_height="match_parent"
32         android:gravity="center_vertical"
33         android:layout_marginBottom="2dip"
34         android:drawablePadding="0dip"
35         android:textAppearance="?attr/textAppearanceMedium"
36         android:textColor="?attr/textColorPrimary"
37         android:visibility="gone" />
39     <ImageView
40         android:id="@+id/search_button"
41         style="?attr/actionButtonStyle"
42         android:layout_width="wrap_content"
43         android:layout_height="match_parent"
44         android:layout_gravity="center_vertical"
45         android:focusable="true"
46         android:contentDescription="@string/searchview_description_search"
47         android:tooltipText="@string/searchview_description_search" />
49     <LinearLayout
50         android:id="@+id/search_edit_frame"
51         android:layout_width="wrap_content"
52         android:layout_height="match_parent"
53         android:layout_weight="1"
54         android:layout_marginStart="8dip"
55         android:layout_marginEnd="8dip"
56         android:orientation="horizontal"
57         android:layoutDirection="locale">
59         <ImageView
60             android:id="@+id/search_mag_icon"
61             android:layout_width="@dimen/dropdownitem_icon_width"
62             android:layout_height="wrap_content"
63             android:scaleType="centerInside"
64             android:layout_marginStart="@dimen/dropdownitem_text_padding_left"
65             android:layout_gravity="center_vertical"
66             android:visibility="gone" />
68         <!-- Inner layout contains the app icon, button(s) and EditText -->
69         <LinearLayout
70             android:id="@+id/search_plate"
71             android:layout_width="wrap_content"
72             android:layout_height="match_parent"
73             android:layout_weight="1"
74             android:layout_gravity="center_vertical"
75             android:orientation="horizontal">
77             <view class="android.widget.SearchView$SearchAutoComplete"
78                 android:id="@+id/search_src_text"
79                 android:layout_height="36dip"
80                 android:layout_width="0dp"
81                 android:layout_weight="1"
82                 android:layout_gravity="center_vertical"
83                 android:paddingStart="@dimen/dropdownitem_text_padding_left"
84                 android:paddingEnd="@dimen/dropdownitem_text_padding_right"
85                 android:singleLine="true"
86                 android:ellipsize="end"
87                 android:background="@null"
88                 android:inputType="text|textAutoComplete|textNoSuggestions"
89                 android:imeOptions="actionSearch"
90                 android:dropDownHeight="wrap_content"
91                 android:dropDownAnchor="@id/search_edit_frame"
92                 android:dropDownVerticalOffset="0dip"
93                 android:dropDownHorizontalOffset="0dip" />
95             <ImageView
96                 android:id="@+id/search_close_btn"
97                 android:layout_width="wrap_content"
98                 android:layout_height="match_parent"
99                 android:paddingStart="8dip"
100                 android:paddingEnd="8dip"
101                 android:layout_gravity="center_vertical"
102                 android:background="?attr/selectableItemBackgroundBorderless"
103                 android:focusable="true"
104                 android:contentDescription="@string/searchview_description_clear" />
106         </LinearLayout>
108         <LinearLayout
109             android:id="@+id/submit_area"
110             android:orientation="horizontal"
111             android:layout_width="wrap_content"
112             android:layout_height="match_parent">
114             <ImageView
115                 android:id="@+id/search_go_btn"
116                 android:layout_width="wrap_content"
117                 android:layout_height="match_parent"
118                 android:layout_gravity="center_vertical"
119                 android:paddingStart="16dip"
120                 android:paddingEnd="16dip"
121                 android:background="?attr/selectableItemBackgroundBorderless"
122                 android:visibility="gone"
123                 android:focusable="true"
124                 android:contentDescription="@string/searchview_description_submit" />
126             <ImageView
127                 android:id="@+id/search_voice_btn"
128                 android:layout_width="wrap_content"
129                 android:layout_height="match_parent"
130                 android:layout_gravity="center_vertical"
131                 android:paddingStart="16dip"
132                 android:paddingEnd="16dip"
133                 android:background="?attr/selectableItemBackgroundBorderless"
134                 android:visibility="gone"
135                 android:focusable="true"
136                 android:contentDescription="@string/searchview_description_voice" />
137         </LinearLayout>
138     </LinearLayout>
139 </LinearLayout>