search_view.xml revision 405c1af75607fafdb1d6faf34e13e032e4934787
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 */
18
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"
26    >
27
28    <!-- This is actually used for the badge icon *or* the badge label (or neither) -->
29    <TextView
30        android:id="@+id/search_badge"
31        android:layout_width="wrap_content"
32        android:layout_height="match_parent"
33        android:layout_gravity="center_vertical"
34        android:layout_marginBottom="2dip"
35        android:drawablePadding="0dip"
36        android:textAppearance="?android:attr/textAppearanceMedium"
37        android:textColor="?android:attr/textColorPrimary"
38        android:visibility="gone"
39    />
40
41    <ImageView
42        android:id="@+id/search_button"
43        android:layout_height="wrap_content"
44        android:layout_width="wrap_content"
45        android:layout_gravity="center_vertical"
46        android:background="?android:attr/selectableItemBackground"
47        android:src="?android:attr/searchViewSearchIcon"
48        style="?android:attr/actionButtonStyle"
49    />
50
51    <LinearLayout
52        android:id="@+id/search_edit_frame"
53        android:layout_width="wrap_content"
54        android:layout_height="wrap_content"
55        android:layout_weight="1"
56        android:layout_gravity="center_vertical"
57        android:layout_marginLeft="16dip"
58        android:layout_marginRight="16dip"
59        android:layout_marginTop="4dip"
60        android:layout_marginBottom="4dip"
61        android:orientation="horizontal">
62
63        <!-- Inner layout contains the app icon, button(s) and EditText -->
64        <LinearLayout
65            android:id="@+id/search_plate"
66            android:layout_width="wrap_content"
67            android:layout_height="wrap_content"
68            android:layout_weight="1"
69            android:layout_gravity="center_vertical"
70            android:orientation="horizontal"
71            android:background="?android:attr/searchViewTextField">
72
73            <ImageView
74                android:id="@+id/search_app_icon"
75                android:layout_width="wrap_content"
76                android:layout_height="match_parent"
77                android:layout_marginRight="7dip"
78                android:layout_gravity="center_vertical"
79                android:src="?android:attr/searchViewSearchIcon"
80            />
81
82            <view class="android.widget.SearchView$SearchAutoComplete"
83                android:id="@+id/search_src_text"
84                android:layout_height="36dip"
85                android:layout_width="0dp"
86                android:layout_weight="1"
87                android:minWidth="@dimen/search_view_text_min_width"
88                android:layout_gravity="bottom"
89                android:paddingLeft="8dip"
90                android:paddingRight="6dip"
91                android:drawablePadding="2dip"
92                android:singleLine="true"
93                android:ellipsize="end"
94                android:background="@null"
95                android:inputType="text|textAutoComplete"
96                android:imeOptions="actionSearch"
97                android:dropDownHeight="wrap_content"
98                android:dropDownAnchor="@id/search_edit_frame"
99                android:dropDownVerticalOffset="0dip"
100                android:dropDownHorizontalOffset="0dip"
101            />
102
103            <ImageView
104                android:id="@+id/search_close_btn"
105                android:layout_width="wrap_content"
106                android:layout_height="match_parent"
107                android:paddingLeft="8dip"
108                android:paddingRight="8dip"
109                android:layout_gravity="center_vertical"
110                android:background="?android:attr/selectableItemBackground"
111                android:src="?android:attr/searchViewCloseIcon"
112                android:focusable="true"
113            />
114
115        </LinearLayout>
116
117        <LinearLayout
118            android:id="@+id/submit_area"
119            android:orientation="horizontal"
120            android:layout_width="wrap_content"
121            android:layout_height="match_parent"
122            android:background="?android:attr/searchViewTextFieldRight">
123    
124            <ImageView
125                android:id="@+id/search_go_btn"
126                android:layout_width="wrap_content"
127                android:layout_height="match_parent"
128                android:layout_gravity="center_vertical"
129                android:paddingLeft="16dip"
130                android:paddingRight="16dip"
131                android:background="?android:attr/selectableItemBackground"
132                android:src="?android:attr/searchViewGoIcon"
133                android:visibility="gone"
134                android:focusable="true"
135            />
136    
137            <ImageView
138                android:id="@+id/search_voice_btn"
139                android:layout_width="wrap_content"
140                android:layout_height="match_parent"
141                android:layout_gravity="center_vertical"
142                android:paddingLeft="16dip"
143                android:paddingRight="16dip"
144                android:src="?android:attr/searchViewVoiceIcon"
145                android:background="?android:attr/selectableItemBackground"
146                android:visibility="gone"
147                android:focusable="true"
148            />
149        </LinearLayout>
150    </LinearLayout>
151
152</LinearLayout>
153