summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBjorn Bringert <bringert@android.com>2009-05-22 13:42:29 +0100
committerBjorn Bringert <bringert@android.com>2009-05-22 13:42:29 +0100
commiteb128730b5e542ba47d13f79fff83590e19a8deb (patch)
tree0b28e8a1269d4fe7874e597968d0da2e63920f37 /core
parent90bd7338df76c0a6185f4ff2fe7f981fa1a1d36c (diff)
downloadframeworks_base-eb128730b5e542ba47d13f79fff83590e19a8deb.zip
frameworks_base-eb128730b5e542ba47d13f79fff83590e19a8deb.tar.gz
frameworks_base-eb128730b5e542ba47d13f79fff83590e19a8deb.tar.bz2
Fixed vertical text position in search suggestion items.
Background: mlebeau said: "Cole had complained that the vertical alignment of the text fields in search_dropdown_item_icons_2line.xml was a little off. Specifically, when both lines are visible he wanted to see line1 pushed down 2-4 pixels (while keeping line2 in the same position as now), and when only line1 is visible, he said it needed to be pushed up 2-4 pixels from current." Here's how the layout worked before (note that text2 and text1 are in this order in the layout file): - If text2 is present, it is put at the bottom, with height set by layout_height (currently 29dip) . - The line2 text is put at the top of text2 (gravity=top). - I think the paddingBottom=4dip in text2 has no effect, since the text is top-aligned anyway. - text1 is put at the top of the list item. If text2 is present, it will have height 29dip (58 dip - 29 dip height of text2). It's a bit weird, layout_height of text1 is completely ignored, but it has to be set to something. If text2 is missing, it will fill the entire list item height (58 dip). - The line1 text is placed 4dip below the vertical center of text1 (4dip because of paddingTop). Now, instead, text1 has height=wrap_content, and is placed right above text2, if that's present. If text2 is absent, text1 is centered vertically in the list item. This should have the desired effect. If we want to tweak the positioning further in the case where text2 is visible, we can adjust the padding of text1.
Diffstat (limited to 'core')
-rw-r--r--core/res/res/layout/search_dropdown_item_icons_2line.xml9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/res/res/layout/search_dropdown_item_icons_2line.xml b/core/res/res/layout/search_dropdown_item_icons_2line.xml
index 0d07490..2710b3b 100644
--- a/core/res/res/layout/search_dropdown_item_icons_2line.xml
+++ b/core/res/res/layout/search_dropdown_item_icons_2line.xml
@@ -67,13 +67,10 @@
android:textAppearance="?android:attr/textAppearanceSearchResultTitle"
android:singleLine="true"
android:layout_width="fill_parent"
- android:layout_height="29dip"
- android:paddingTop="4dip"
- android:gravity="center_vertical"
- android:layout_alignParentTop="true"
+ android:layout_height="wrap_content"
+ android:layout_centerVertical="true"
android:layout_toRightOf="@android:id/icon1"
android:layout_toLeftOf="@android:id/icon2"
- android:layout_above="@android:id/text2"
- android:layout_alignWithParentIfMissing="true" />
+ android:layout_above="@android:id/text2" />
</RelativeLayout>