search_bar.xml revision e29f064383cbc745c8605c707000ab4e16ee0aac
1<?xml version="1.0" encoding="utf-8"?> 2<!-- 3/* apps/common/res/layout/SearchBar.xml 4** 5** Copyright 2007, The Android Open Source Project 6** 7** Licensed under the Apache License, Version 2.0 (the "License"); 8** you may not use this file except in compliance with the License. 9** You may obtain a copy of the License at 10** 11** http://www.apache.org/licenses/LICENSE-2.0 12** 13** Unless required by applicable law or agreed to in writing, software 14** distributed under the License is distributed on an "AS IS" BASIS, 15** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16** See the License for the specific language governing permissions and 17** limitations under the License. 18*/ 19--> 20<LinearLayout 21 xmlns:android="http://schemas.android.com/apk/res/android" 22 android:id="@+id/search_bar" 23 android:layout_width="fill_parent" 24 android:layout_height="wrap_content" 25 android:orientation="vertical" 26 android:focusable="true" 27 android:descendantFocusability="afterDescendants"> 28 29 <!-- Outer layout defines the entire search bar at the top of the screen --> 30 <LinearLayout 31 android:id="@+id/search_plate" 32 android:layout_width="fill_parent" 33 android:layout_height="wrap_content" 34 android:orientation="vertical" 35 android:paddingLeft="12dip" 36 android:paddingRight="12dip" 37 android:paddingTop="7dip" 38 android:paddingBottom="16dip" 39 android:background="@drawable/search_plate_global" > 40 41 <!-- This is actually used for the badge icon *or* the badge label (or neither) --> 42 <TextView 43 android:id="@+id/search_badge" 44 android:layout_width="wrap_content" 45 android:layout_height="wrap_content" 46 android:layout_marginBottom="2dip" 47 android:drawablePadding="0dip" 48 android:textAppearance="?android:attr/textAppearanceSmall" 49 android:textColor="?android:attr/textColorPrimaryInverse" /> 50 51 <!-- Inner layout contains the app icon, button(s) and EditText --> 52 <LinearLayout 53 android:id="@+id/search_edit_frame" 54 android:layout_width="fill_parent" 55 android:layout_height="wrap_content" 56 android:orientation="horizontal"> 57 58 <ImageView 59 android:id="@+id/search_app_icon" 60 android:layout_height="36dip" 61 android:layout_width="36dip" 62 android:layout_marginRight="7dip" 63 android:layout_gravity="center_vertical" 64 /> 65 66 <view class="android.app.SearchDialog$SearchAutoComplete" 67 android:id="@+id/search_src_text" 68 android:background="@drawable/textfield_search" 69 android:layout_height="wrap_content" 70 android:layout_width="0dip" 71 android:layout_weight="1.0" 72 android:paddingLeft="8dip" 73 android:paddingRight="6dip" 74 android:drawablePadding="2dip" 75 android:singleLine="true" 76 android:ellipsize="end" 77 android:inputType="text|textAutoComplete" 78 android:dropDownWidth="fill_parent" 79 android:dropDownHeight="fill_parent" 80 android:dropDownAnchor="@id/search_plate" 81 android:dropDownVerticalOffset="-9dip" 82 android:popupBackground="@android:drawable/search_dropdown_background" 83 /> 84 85 <!-- This button can switch between text and icon "modes" --> 86 <Button 87 android:id="@+id/search_go_btn" 88 android:background="@drawable/btn_search_dialog" 89 android:layout_width="wrap_content" 90 android:layout_height="fill_parent" 91 /> 92 93 <ImageButton 94 android:id="@+id/search_voice_btn" 95 android:layout_width="wrap_content" 96 android:layout_height="fill_parent" 97 android:layout_marginLeft="8dip" 98 android:background="@drawable/btn_search_dialog_voice" 99 android:src="@android:drawable/ic_btn_speak_now" 100 /> 101 </LinearLayout> 102 103 </LinearLayout> 104 105</LinearLayout> 106