Merge "Adjusting padding and fonts in contact detail" into honeycomb
diff --git a/res/layout-xlarge-land/contact_detail_list_item.xml b/res/layout-xlarge-land/contact_detail_list_item.xml
index 394d6c0..529059a 100644
--- a/res/layout-xlarge-land/contact_detail_list_item.xml
+++ b/res/layout-xlarge-land/contact_detail_list_item.xml
@@ -17,33 +17,33 @@
*/
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
->
+ android:orientation="vertical">
+
<!-- Longer separating line (between kinds) -->
<View
android:id="@+id/kind_divider"
android:layout_width="match_parent"
android:layout_height="1px"
- android:background="@drawable/list_item_divider_holo"
- />
+ android:background="@drawable/list_item_divider_holo" />
+
<!-- Shorter separating line if there was no kind-separator -->
<View
android:id="@+id/in_kind_divider"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginLeft="164dip"
- android:background="@drawable/list_item_divider_holo"
- />
+ android:background="@drawable/list_item_divider_holo" />
+
<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical"
- android:minHeight="?android:attr/listPreferredItemHeight">
+ android:minHeight="@dimen/detail_min_line_item_height">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -52,14 +52,13 @@
<TextView
android:id="@+id/kind"
android:layout_width="164dip"
- android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_height="@dimen/detail_min_line_item_height"
android:paddingLeft="19dip"
- android:textColor="#7F7F7F"
android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorTertiary"
android:singleLine="true"
android:ellipsize="marquee"
- android:gravity="center_vertical"
- />
+ android:gravity="center_vertical" />
<LinearLayout
android:layout_width="wrap_content"
@@ -72,44 +71,38 @@
android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceLarge"
- />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<TextView
android:id="@+id/footer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:visibility="gone"
- />
+ android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/type"
android:layout_width="wrap_content"
- android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_height="@dimen/detail_min_line_item_height"
android:maxWidth="150dip"
- android:textColor="#999999"
android:gravity="right|center_vertical"
- android:textAppearance="?android:attr/textAppearanceSmall"
- />
+ android:textColor="@color/detail_item_type_color"
+ android:textAppearance="?android:attr/textAppearanceSmall" />
<ImageView
android:id="@+id/presence_icon"
- android:layout_width="wrap_content"
- android:layout_height="?android:attr/listPreferredItemHeight"
+ android:layout_width="32dip"
+ android:layout_height="@dimen/detail_min_line_item_height"
android:layout_marginLeft="5dip"
android:gravity="center"
- android:scaleType="centerInside"
- />
+ android:scaleType="centerInside" />
<ImageView
android:id="@+id/action_icon"
- android:layout_width="30dip"
- android:layout_height="?android:attr/listPreferredItemHeight"
- android:layout_marginLeft="14dip"
- android:layout_marginRight="14dip"
+ android:layout_width="32dip"
+ android:layout_height="@dimen/detail_min_line_item_height"
+ android:layout_marginLeft="16dip"
android:layout_gravity="center_vertical"
- android:scaleType="centerInside"
- />
+ android:scaleType="centerInside" />
<View
android:id="@+id/divider"
@@ -117,27 +110,25 @@
android:layout_height="match_parent"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
- android:background="@drawable/divider_vertical_dark"
- />
+ android:layout_marginLeft="14dip"
+ android:layout_marginRight="14dip"
+ android:background="?android:attr/dividerVertical" />
<ImageView
android:id="@+id/secondary_action_button"
- android:layout_width="58dip"
+ android:layout_width="32dip"
android:layout_height="match_parent"
android:layout_centerVertical="true"
- android:paddingLeft="14dip"
- android:paddingRight="14dip"
android:gravity="center"
android:scaleType="center"
- android:background="@android:drawable/list_selector_background"
- />
+ android:background="?android:attr/selectableItemBackground" />
</LinearLayout>
</LinearLayout>
+
<!-- Longer separating line (only for the last row) -->
<View
android:id="@+id/line_below_last"
android:layout_width="match_parent"
android:layout_height="1px"
- android:background="@drawable/list_item_divider_holo"
- />
+ android:background="@drawable/list_item_divider_holo" />
</LinearLayout>
diff --git a/res/layout-xlarge/contact_detail_fragment.xml b/res/layout-xlarge/contact_detail_fragment.xml
index 4c1759d..60d3cd5 100644
--- a/res/layout-xlarge/contact_detail_fragment.xml
+++ b/res/layout-xlarge/contact_detail_fragment.xml
@@ -38,7 +38,7 @@
ex:layout_wideMarginRight="48dip"
ex:layout_narrowParentWidth="500dip"
ex:layout_narrowMarginLeft="15dip"
- ex:layout_narrowMarginRight="5dip"
+ ex:layout_narrowMarginRight="16dip"
/>
</com.android.contacts.widget.InterpolatingLayout>
@@ -76,7 +76,7 @@
ex:layout_widePaddingRight="48dip"
ex:layout_narrowParentWidth="500dip"
ex:layout_narrowMarginLeft="32dip"
- ex:layout_narrowPaddingRight="0dip"
+ ex:layout_narrowPaddingRight="16dip"
android:cacheColorHint="#00000000"
android:divider="@android:color/transparent"
/>
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index 3b249b3..13b07bb 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -17,54 +17,51 @@
*/
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
->
+ android:orientation="vertical">
+
<!-- Seperator that shows the kind -->
- <LinearLayout android:id="@+id/kind_divider"
+ <LinearLayout
+ android:id="@+id/kind_divider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- >
+ android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="1px"
- android:background="@drawable/list_item_divider_holo"
- />
+ android:background="@drawable/list_item_divider_holo" />
<TextView
android:id="@+id/kind"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="31dip"
android:paddingLeft="16dip"
- android:background="#ffff"
- android:textColor="#7F7F7F"
- />
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorTertiary" />
<ImageView
android:layout_width="match_parent"
android:layout_height="1px"
- android:background="@drawable/list_item_divider_holo"
- />
+ android:background="@drawable/list_item_divider_holo" />
</LinearLayout>
-
+
<!-- Shorter seperating line if there was no kind-seperator -->
<ImageView
android:id="@+id/in_kind_divider"
android:layout_marginLeft="31dip"
android:layout_width="match_parent"
android:layout_height="1px"
- android:background="@drawable/list_item_divider_holo"
- />
+ android:background="@drawable/list_item_divider_holo" />
+
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="?android:attr/listPreferredItemHeight"
+ android:minHeight="@dimen/detail_min_line_item_height"
android:orientation="horizontal"
android:paddingLeft="31dip"
- android:gravity="center_vertical"
- >
+ android:gravity="center_vertical">
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
@@ -73,22 +70,21 @@
android:orientation="vertical"
android:paddingTop="5dip"
android:paddingBottom="7dip"
- android:gravity="center_vertical"
- >
+ android:gravity="center_vertical">
- <TextView android:id="@+id/data"
+ <TextView
+ android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
- android:textAppearance="?android:attr/textAppearanceLarge"
- />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
- <TextView android:id="@+id/type"
+ <TextView
+ android:id="@+id/type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="#7F7F7F"
- />
+ android:textColor="@color/detail_item_type_color" />
<TextView
android:id="@+id/footer"
@@ -100,40 +96,39 @@
</LinearLayout>
- <ImageView android:id="@+id/presence_icon"
- android:layout_width="wrap_content"
+ <ImageView
+ android:id="@+id/presence_icon"
+ android:layout_width="32dip"
android:layout_height="wrap_content"
android:layout_marginLeft="5dip"
android:gravity="center"
- android:scaleType="centerInside"
- />
+ android:scaleType="centerInside" />
- <ImageView android:id="@+id/action_icon"
- android:layout_width="30dip"
- android:layout_height="30dip"
- android:layout_marginLeft="14dip"
- android:layout_marginRight="14dip"
+ <ImageView
+ android:id="@+id/action_icon"
+ android:layout_width="32dip"
+ android:layout_height="32dip"
+ android:layout_marginLeft="16dip"
android:gravity="center"
- android:scaleType="centerInside"
- />
+ android:scaleType="centerInside" />
- <View android:id="@+id/divider"
+ <View
+ android:id="@+id/divider"
android:layout_width="1px"
android:layout_height="match_parent"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
- android:background="@drawable/divider_vertical_dark"
- />
+ android:layout_marginLeft="14dip"
+ android:layout_marginRight="14dip"
+ android:background="?android:attr/dividerVertical" />
- <ImageView android:id="@+id/secondary_action_button"
- android:layout_width="58dip"
+ <ImageView
+ android:id="@+id/secondary_action_button"
+ android:layout_width="32dip"
android:layout_height="match_parent"
android:layout_centerVertical="true"
- android:paddingLeft="14dip"
- android:paddingRight="14dip"
android:gravity="center"
android:scaleType="center"
- android:background="@android:drawable/list_selector_background"
- />
+ android:background="?android:attr/selectableItemBackground" />
</LinearLayout>
</LinearLayout>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 845cb2f..69f92ad 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -36,4 +36,7 @@
<!-- Color of the line above the contact photo in the contact detail header -->
<color name="contact_detail_header_divider_color">#FF999999</color>
+
+ <!-- Color of the text indicating the type of entry (e.g. Home, Work etc) -->
+ <color name="detail_item_type_color">#B4B4B4</color>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index c583bae..d55ebd6 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -46,6 +46,9 @@
<!-- Minimum height of a row in the Editor -->
<dimen name="editor_min_line_item_height">48dip</dimen>
+ <!-- Minimum height of a row in the contact detail -->
+ <dimen name="detail_min_line_item_height">48dip</dimen>
+
<!-- Padding to be used between a visible scrollbar and the contact list -->
<dimen name="list_visible_scrollbar_padding">40dip</dimen>
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index bed532d..5dde900 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -574,7 +574,7 @@
sb.append(groups.get(i));
}
entry.mimetype = GroupMembership.MIMETYPE;
- entry.kind = mContext.getString(R.string.groupsLabel).toUpperCase();
+ entry.kind = mContext.getString(R.string.groupsLabel);
entry.data = sb.toString();
mGroupEntries.add(entry);
}
@@ -727,7 +727,7 @@
entry.uri = ContentUris.withAppendedId(Data.CONTENT_URI, entry.id);
entry.mimetype = mimeType;
entry.kind = (kind.titleRes == -1 || kind.titleRes == 0) ? ""
- : context.getString(kind.titleRes).toUpperCase();
+ : context.getString(kind.titleRes);
entry.data = buildDataString(kind, values, context);
if (kind.typeColumn != null && values.containsKey(kind.typeColumn)) {
diff --git a/src/com/android/contacts/editor/GroupMembershipView.java b/src/com/android/contacts/editor/GroupMembershipView.java
index ad246e5..c0b3644 100644
--- a/src/com/android/contacts/editor/GroupMembershipView.java
+++ b/src/com/android/contacts/editor/GroupMembershipView.java
@@ -112,7 +112,7 @@
public void setKind(DataKind kind) {
mKind = kind;
TextView kindTitle = (TextView) findViewById(R.id.kind_title);
- kindTitle.setText(getResources().getString(kind.titleRes).toUpperCase());
+ kindTitle.setText(getResources().getString(kind.titleRes));
}
public void setGroupMetaData(Cursor groupMetaData) {
diff --git a/src/com/android/contacts/editor/KindSectionView.java b/src/com/android/contacts/editor/KindSectionView.java
index d0a774d..77484ce 100644
--- a/src/com/android/contacts/editor/KindSectionView.java
+++ b/src/com/android/contacts/editor/KindSectionView.java
@@ -151,7 +151,7 @@
mTitleString = (kind.titleRes == -1 || kind.titleRes == 0)
? ""
: getResources().getString(kind.titleRes);
- mTitle.setText(mTitleString.toUpperCase());
+ mTitle.setText(mTitleString);
rebuildFromState();
updateAddVisible();