Bjorn Bringert
eb128730b5
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.
Description
No description provided
Languages
Java
77.3%
Kotlin
9.2%
PowerBuilder
6.6%
C++
5.5%
AIDL
1%