summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorJin Cao <jinyan@google.com>2014-07-31 10:32:05 -0700
committerJin Cao <jinyan@google.com>2014-07-31 10:32:05 -0700
commitdc71a1d2cb7f1e216ace9781d29edbdb4d9bff7d (patch)
tree8b7b08fa4fe92c9d7493fc42e4bcc5c3f94e3d7c /res
parentfae9b8831eaa8a05943018fa40ceb1b95e4ec28b (diff)
downloadchips-dc71a1d2cb7f1e216ace9781d29edbdb4d9bff7d.tar.gz
[Quantum chips] restyle text views
Restyle the text views and their parent layout to properly align vertically when one of the textviews is set to GONE. Previously lost the behavior with the change from RelativeLayout to LinearLayout since LinearLayout will always set the child to top regardless of it's layout_gravity. b/16383133 Change-Id: I6543af42f1e7e05e6a213ba3f37107d90439808d
Diffstat (limited to 'res')
-rw-r--r--res/layout/chips_autocomplete_recipient_dropdown_item.xml6
-rw-r--r--res/layout/chips_recipient_dropdown_item.xml6
-rw-r--r--res/values/styles.xml10
3 files changed, 10 insertions, 12 deletions
diff --git a/res/layout/chips_autocomplete_recipient_dropdown_item.xml b/res/layout/chips_autocomplete_recipient_dropdown_item.xml
index d3d0c8f..9b9ef7a 100644
--- a/res/layout/chips_autocomplete_recipient_dropdown_item.xml
+++ b/res/layout/chips_autocomplete_recipient_dropdown_item.xml
@@ -20,11 +20,7 @@
android:background="@drawable/chips_dropdown_background"
style="@style/ChipAutocompleteWrapperStyle">
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="vertical">
+ <LinearLayout style="@style/ChipTextViewLayoutStyle">
<TextView style="@style/ChipTitleStyle" />
diff --git a/res/layout/chips_recipient_dropdown_item.xml b/res/layout/chips_recipient_dropdown_item.xml
index 8587baa..a0f33d6 100644
--- a/res/layout/chips_recipient_dropdown_item.xml
+++ b/res/layout/chips_recipient_dropdown_item.xml
@@ -22,11 +22,7 @@
<com.android.ex.chips.CircularImageView style="@style/ChipStartIconStyle" />
- <LinearLayout
- android:layout_width="0dp"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:orientation="vertical">
+ <LinearLayout style="@style/ChipTextViewLayoutStyle">
<TextView style="@style/ChipTitleStyle" />
diff --git a/res/values/styles.xml b/res/values/styles.xml
index bdee911..e5c7294 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -39,11 +39,18 @@
<item name="android:paddingBottom">@dimen/chip_wrapper_bottom_padding</item>
</style>
+ <style name="ChipTextViewLayoutStyle">
+ <item name="android:layout_width">0dp</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:layout_gravity">center_vertical</item>
+ <item name="android:layout_weight">1</item>
+ <item name="android:orientation">vertical</item>
+ </style>
+
<style name="ChipTitleStyle">
<item name="android:id">@android:id/title</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_gravity">center_vertical</item>
<item name="android:ellipsize">middle</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">@color/chips_dropdown_title_text</item>
@@ -54,7 +61,6 @@
<item name="android:id">@android:id/text1</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
- <item name="android:layout_gravity">center_vertical</item>
<item name="android:ellipsize">middle</item>
<item name="android:singleLine">true</item>
<item name="android:textColor">@color/chips_dropdown_subtitle_text</item>