1 <?xml version="1.0" encoding="utf-8"?>
5 ** Copyright 2008, The Android Open Source Project
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
11 ** http://www.apache.org/licenses/LICENSE-2.0
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.
21 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
22 android:paddingStart="@dimen/dropdownitem_text_padding_left"
23 android:paddingEnd="4dip"
24 android:layout_width="match_parent"
25 android:layout_height="?attr/searchResultListItemHeight" >
27 <!-- Icons come first in the layout, since their placement doesn't depend on
28 the placement of the text views. -->
29 <ImageView android:id="@id/icon1"
30 android:layout_width="@dimen/dropdownitem_icon_width"
31 android:layout_height="48dip"
32 android:scaleType="centerInside"
33 android:layout_alignParentStart="true"
34 android:layout_alignParentTop="true"
35 android:layout_alignParentBottom="true"
36 android:visibility="invisible" />
38 <ImageView android:id="@+id/edit_query"
39 android:layout_width="48dip"
40 android:layout_height="48dip"
41 android:scaleType="centerInside"
42 android:layout_alignParentEnd="true"
43 android:layout_alignParentTop="true"
44 android:layout_alignParentBottom="true"
45 android:background="?attr/selectableItemBackground"
46 android:visibility="gone" />
48 <ImageView android:id="@id/icon2"
49 android:layout_width="48dip"
50 android:layout_height="48dip"
51 android:scaleType="centerInside"
52 android:layout_alignWithParentIfMissing="true"
53 android:layout_toStartOf="@id/edit_query"
54 android:layout_alignParentTop="true"
55 android:layout_alignParentBottom="true"
56 android:visibility="gone" />
59 <!-- The subtitle comes before the title, since the height of the title depends on whether the
60 subtitle is visible or gone. -->
61 <TextView android:id="@id/text2"
62 style="?attr/dropDownItemStyle"
63 android:textAppearance="?attr/textAppearanceSearchResultSubtitle"
64 android:singleLine="true"
65 android:layout_width="match_parent"
66 android:layout_height="29dip"
67 android:paddingBottom="4dip"
69 android:layout_toEndOf="@id/icon1"
70 android:layout_toStartOf="@id/icon2"
71 android:layout_alignWithParentIfMissing="true"
72 android:layout_alignParentBottom="true"
73 android:visibility="gone" />
75 <!-- The title is placed above the subtitle, if there is one. If there is no
76 subtitle, it fills the parent. -->
77 <TextView android:id="@id/text1"
78 style="?attr/dropDownItemStyle"
79 android:textAppearance="?attr/textAppearanceSearchResultTitle"
80 android:singleLine="true"
81 android:layout_width="match_parent"
82 android:layout_height="wrap_content"
83 android:layout_centerVertical="true"
84 android:layout_toEndOf="@id/icon1"
85 android:layout_toStartOf="@id/icon2"
86 android:layout_above="@id/text2" />