Merge "Use phone icon for the back action in call log details."
diff --git a/res/layout-sw580dp-w1000dp/contact_detail_list_item.xml b/res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
index 4cb4096..b57e85c 100644
--- a/res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
+++ b/res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
@@ -42,7 +42,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
- android:paddingLeft="12dip"
+ android:paddingLeft="8dip"
android:orientation="vertical">
<TextView
@@ -56,6 +56,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary"
android:visibility="gone" />
</LinearLayout>
@@ -68,37 +69,27 @@
android:gravity="center"
android:scaleType="centerInside" />
- <FrameLayout
+ <TextView
+ android:id="@+id/kind"
android:layout_width="wrap_content"
- android:layout_height="@dimen/detail_min_line_item_height"
- android:paddingLeft="@dimen/detail_item_side_margin"
- android:paddingRight="@dimen/detail_item_side_margin">
+ android:layout_height="wrap_content"
+ android:visibility="gone" />
- <TextView
- android:id="@+id/kind"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:visibility="gone" />
+ <TextView
+ android:id="@+id/type"
+ style="@style/ContactDetailItemType"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:paddingRight="16dip" />
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:orientation="horizontal">
+ <View
+ android:id="@+id/primary_indicator"
+ android:layout_width="16dip"
+ android:layout_height="16dip"
+ android:visibility="gone"
+ android:layout_gravity="center_vertical"
+ android:background="@drawable/ic_menu_mark" />
- <TextView
- android:id="@+id/type"
- style="@style/ContactDetailItemType" />
-
- <View
- android:id="@+id/primary_indicator"
- android:layout_width="16dip"
- android:layout_height="16dip"
- android:visibility="gone"
- android:layout_gravity="center_vertical"
- android:background="@drawable/ic_menu_mark" />
-
- </LinearLayout>
- </FrameLayout>
</com.android.contacts.detail.PrimaryActionViewContainer>
<View
diff --git a/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml
index dce00ac..6ce811f 100644
--- a/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml
+++ b/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml
@@ -52,7 +52,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary" />
<CheckBox
android:id="@+id/star"
diff --git a/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml b/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml
index 486b7c2..be82d88 100644
--- a/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml
+++ b/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml
@@ -36,7 +36,8 @@
android:id="@+id/company"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary" />
<CheckBox
android:id="@+id/star"
diff --git a/res/layout-sw580dp/contact_detail_updates_fragment.xml b/res/layout-sw580dp/contact_detail_updates_fragment.xml
index 8677737..ce3f661 100644
--- a/res/layout-sw580dp/contact_detail_updates_fragment.xml
+++ b/res/layout-sw580dp/contact_detail_updates_fragment.xml
@@ -36,7 +36,7 @@
class="com.android.contacts.widget.ProportionalLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- ex:ratio="0.5"
+ ex:ratio="0.66"
ex:direction="widthToHeight">
<!-- Put a dummy view here because the ProportionalLayout requires one -->
diff --git a/res/layout-sw580dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp/detail_header_contact_with_updates.xml
index 01e4c7e..6b6f02b 100644
--- a/res/layout-sw580dp/detail_header_contact_with_updates.xml
+++ b/res/layout-sw580dp/detail_header_contact_with_updates.xml
@@ -26,14 +26,14 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:layout_marginTop="20dip">
+ android:layout_marginTop="30dip">
<!-- Add a first item that gives us enough space to show the carousel -->
<view
class="com.android.contacts.widget.ProportionalLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- ex:ratio="0.5"
+ ex:ratio="0.66"
ex:direction="widthToHeight">
<!-- Put a dummy view here because the ProportionalLayout requires one -->
@@ -54,7 +54,8 @@
android:id="@+id/company"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary" />
<CheckBox
android:id="@+id/star"
@@ -64,4 +65,4 @@
android:contentDescription="@string/description_star"
style="?android:attr/starStyle" />
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout-sw580dp/detail_header_contact_without_updates.xml b/res/layout-sw580dp/detail_header_contact_without_updates.xml
index 04fbad9..995e8f7 100644
--- a/res/layout-sw580dp/detail_header_contact_without_updates.xml
+++ b/res/layout-sw580dp/detail_header_contact_without_updates.xml
@@ -20,15 +20,42 @@
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
- <ImageView
- android:id="@+id/photo"
- android:scaleType="centerCrop"
- android:layout_width="@dimen/detail_contact_photo_size"
- android:layout_height="@dimen/detail_contact_photo_size" />
+ <!-- Ensure that the contact photo for a contact WITHOUT social updates is the same width and
+ height as a contact WITH social updates (where the photo is 2/3 of the screen width). -->
+ <view
+ class="com.android.contacts.widget.ProportionalLayout"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ ex:ratio="0.66"
+ ex:direction="widthToHeight">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@+id/photo"
+ android:scaleType="centerCrop"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="2" />
+
+ <!-- Empty view to fill the rest of the LinearLayout, so that a weight on its sibling
+ ImageView will work.-->
+ <View
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="match_parent" />
+
+ </LinearLayout>
+
+ </view>
<TextView
android:id="@+id/name"
@@ -41,7 +68,8 @@
android:id="@+id/company"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium" />
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary" />
<CheckBox
android:id="@+id/star"
@@ -51,4 +79,4 @@
android:contentDescription="@string/description_star"
style="?android:attr/starStyle" />
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout-w470dp/contact_detail_fragment.xml b/res/layout-w470dp/contact_detail_fragment.xml
index 5a48583..56c9f20 100644
--- a/res/layout-w470dp/contact_detail_fragment.xml
+++ b/res/layout-w470dp/contact_detail_fragment.xml
@@ -86,7 +86,7 @@
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
- android:background="@android:color/transparent"
+ android:background="?android:attr/selectableItemBackground"
android:visibility="gone"/>
</RelativeLayout>
diff --git a/res/layout-w470dp/contact_detail_updates_fragment.xml b/res/layout-w470dp/contact_detail_updates_fragment.xml
index 9b63ccf..0c8380c 100644
--- a/res/layout-w470dp/contact_detail_updates_fragment.xml
+++ b/res/layout-w470dp/contact_detail_updates_fragment.xml
@@ -58,7 +58,7 @@
android:id="@+id/touch_intercept_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@android:color/transparent"
+ android:background="?android:attr/selectableItemBackground"
android:visibility="gone"/>
</FrameLayout>
diff --git a/res/layout/carousel_about_tab.xml b/res/layout/carousel_about_tab.xml
index e902c8e..ad763be 100644
--- a/res/layout/carousel_about_tab.xml
+++ b/res/layout/carousel_about_tab.xml
@@ -36,8 +36,18 @@
android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
+ android:background="#7F000000" />
+
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:layout_marginBottom="@dimen/detail_tab_carousel_tab_label_height"
android:background="@android:color/black"
- android:alpha=".25"/>
+ android:alpha="0"
+ android:visibility="gone"/>
<TextView
android:id="@+id/label"
@@ -53,16 +63,6 @@
style="@android:style/Widget.Holo.ActionBar.TabView" />
<View
- android:id="@+id/alpha_overlay"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentTop="true"
- android:background="@android:color/black"
- android:alpha="0"
- android:visibility="gone"/>
-
- <View
android:id="@+id/touch_intercept_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
diff --git a/res/layout/carousel_updates_tab.xml b/res/layout/carousel_updates_tab.xml
index 689e17b..b41829f 100644
--- a/res/layout/carousel_updates_tab.xml
+++ b/res/layout/carousel_updates_tab.xml
@@ -42,22 +42,7 @@
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_above="@id/status_photo"
- android:background="@android:color/black"
- android:alpha=".25"/>
-
- <TextView
- android:id="@+id/label"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
- android:layout_alignParentLeft="true"
- android:layout_alignParentBottom="true"
- android:layout_above="@id/status_photo"
- android:paddingLeft="@dimen/detail_tab_carousel_tab_label_indent"
- android:singleLine="true"
- android:gravity="left|center_vertical"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/detail_tab_carousel_tab_label_color"
- style="@android:style/Widget.Holo.ActionBar.TabView" />
+ android:background="#7F000000" />
<TextView android:id="@+id/status"
android:layout_width="wrap_content"
@@ -79,10 +64,25 @@
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
+ android:layout_marginBottom="@dimen/detail_tab_carousel_tab_label_height"
android:background="@android:color/black"
android:alpha="0"
android:visibility="gone"/>
+ <TextView
+ android:id="@+id/label"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentBottom="true"
+ android:layout_above="@id/status_photo"
+ android:paddingLeft="@dimen/detail_tab_carousel_tab_label_indent"
+ android:singleLine="true"
+ android:gravity="left|center_vertical"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="@color/detail_tab_carousel_tab_label_color"
+ style="@android:style/Widget.Holo.ActionBar.TabView" />
+
<View
android:id="@+id/touch_intercept_overlay"
android:layout_width="match_parent"
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index 205bc81..e2818e9 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -24,6 +24,8 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
+ android:paddingTop="12dip"
+ android:paddingBottom="12dip"
android:minHeight="@dimen/detail_min_line_item_height">
<!-- Note: padding might be controlled programatically -->
@@ -64,7 +66,9 @@
<TextView
android:id="@+id/type"
- style="@style/ContactDetailItemType" />
+ style="@style/ContactDetailItemType"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
<View
android:id="@+id/primary_indicator"
@@ -82,6 +86,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorSecondary"
android:visibility="gone" />
</LinearLayout>
diff --git a/res/layout/contact_detail_network_title_entry_view.xml b/res/layout/contact_detail_network_title_entry_view.xml
index 2cede93..bc0d3f1 100644
--- a/res/layout/contact_detail_network_title_entry_view.xml
+++ b/res/layout/contact_detail_network_title_entry_view.xml
@@ -32,6 +32,8 @@
android:id="@+id/network_icon"
android:layout_width="@dimen/detail_network_icon_size"
android:layout_height="@dimen/detail_network_icon_size"
+ android:layout_marginLeft="@dimen/detail_item_icon_margin"
+ android:layout_marginRight="@dimen/detail_item_icon_margin"
android:layout_gravity="center_vertical"
android:scaleType="centerInside" />
@@ -39,7 +41,6 @@
android:id="@+id/network_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/detail_item_side_margin"
android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium" />
diff --git a/res/layout/contact_tile_starred_secondary_target.xml b/res/layout/contact_tile_starred_secondary_target.xml
index 4b2639b..887fa5d 100644
--- a/res/layout/contact_tile_starred_secondary_target.xml
+++ b/res/layout/contact_tile_starred_secondary_target.xml
@@ -33,18 +33,42 @@
android:layout_width="match_parent"
android:layout_height="@dimen/contact_tile_shadowbox_height"
android:layout_alignParentBottom="true"
+ android:layout_alignParentLeft="true"
style="@style/ContactTileStarredShadowBox" />
- <TextView
- android:id="@+id/contact_tile_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ <FrameLayout
+ android:id="@+id/contact_tile_info_layout"
+ android:layout_height="@dimen/contact_tile_shadowbox_height"
+ android:layout_width="wrap_content"
+ android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="8dip"
- android:layout_marginBottom="20dip"
- android:textColor="@android:color/white"
- stlye="@style/ContactTileStarredName" />
+ android:layout_marginRight="45dip">
+
+ <TextView
+ android:id="@+id/contact_tile_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:textColor="@android:color/white"
+ android:singleLine="true"
+ android:textSize="16sp"
+ android:fadingEdge="horizontal"
+ android:fadingEdgeLength="3dip"
+ android:ellipsize="marquee" />
+
+ </FrameLayout>
+
+ <View
+ android:id="@+id/vertical_divider"
+ android:layout_width="1dip"
+ android:layout_height="24dip"
+ android:layout_alignParentBottom="true"
+ android:layout_alignParentRight="true"
+ android:layout_marginBottom="12dip"
+ android:layout_marginRight="44dip"
+ android:background="?android:attr/dividerVertical" />
<ImageButton
android:id="@+id/contact_tile_push_state"
@@ -57,9 +81,11 @@
android:src="@drawable/ic_tab_unselected_contacts"
android:background="?android:attr/selectableItemBackground"
android:layout_height="@dimen/contact_tile_shadowbox_height"
- android:layout_width="wrap_content"
+ android:layout_width="32dip"
android:layout_alignParentBottom="true"
- android:layout_alignParentRight="true" />
+ android:layout_alignParentRight="true"
+ android:layout_marginLeft="8dip"
+ android:layout_marginRight="8dip" />
</RelativeLayout>
diff --git a/res/layout/group_browse_list_item.xml b/res/layout/group_browse_list_item.xml
index ecdc132..b9b272c 100644
--- a/res/layout/group_browse_list_item.xml
+++ b/res/layout/group_browse_list_item.xml
@@ -19,6 +19,8 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:minHeight="@dimen/detail_min_line_item_height"
+ android:paddingRight="20dip"
android:paddingBottom="10dip"
style="@style/GroupBrowseListItem">
@@ -37,25 +39,76 @@
layout="@layout/group_browse_list_account_header"
android:visibility="gone" />
- <TextView
- android:id="@+id/label"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:paddingLeft="10dip"
- android:paddingRight="10dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:ellipsize="end"
- android:singleLine="true" />
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
- <TextView
- android:id="@+id/count"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:paddingLeft="10dip"
- android:paddingRight="10dip"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:ellipsize="end"
- android:singleLine="true" />
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:layout_toLeftOf="@+id/icons"
+ android:layout_alignParentLeft="true"
+ android:layout_centerVertical="true">
+ <TextView
+ android:id="@+id/label"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:ellipsize="end"
+ android:singleLine="true" />
+
+ <TextView
+ android:id="@+id/count"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorTertiary"
+ android:ellipsize="end"
+ android:singleLine="true" />
+
+ </LinearLayout>
+
+ <TableLayout
+ android:id="@+id/icons"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_alignParentRight="true"
+ android:layout_centerVertical="true">
+ <TableRow
+ android:layout_marginBottom="1dip">
+ <ImageView
+ android:id="@+id/icon_1"
+ android:layout_width="@dimen/group_list_icon_size"
+ android:layout_height="@dimen/group_list_icon_size"
+ android:layout_marginRight="1dip"
+ android:src="@drawable/ic_contact_picture" />
+ <ImageView
+ android:id="@+id/icon_2"
+ android:layout_width="@dimen/group_list_icon_size"
+ android:layout_height="@dimen/group_list_icon_size"
+ android:src="@drawable/ic_contact_picture" />
+ </TableRow>
+ <TableRow>
+ <ImageView
+ android:id="@+id/icon_3"
+ android:layout_width="@dimen/group_list_icon_size"
+ android:layout_height="@dimen/group_list_icon_size"
+ android:layout_marginRight="1dip"
+ android:src="@drawable/ic_contact_picture" />
+ <ImageView
+ android:id="@+id/icon_4"
+ android:layout_width="@dimen/group_list_icon_size"
+ android:layout_height="@dimen/group_list_icon_size"
+ android:src="@drawable/ic_contact_picture" />
+ </TableRow>
+
+ </TableLayout>
+ </RelativeLayout>
</LinearLayout>
+
diff --git a/res/values-sw580dp-w720dp/styles.xml b/res/values-sw580dp-w720dp/styles.xml
index d4487b2..4de10b6 100644
--- a/res/values-sw580dp-w720dp/styles.xml
+++ b/res/values-sw580dp-w720dp/styles.xml
@@ -16,6 +16,8 @@
<resources>
<style name="PeopleTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
+ <item name="android:textColorPrimary">@color/primary_text_color</item>
+ <item name="android:textColorSecondary">@color/secondary_text_color</item>
<item name="list_item_height">66dip</item>
<item name="activated_background">@drawable/list_item_activated_background</item>
<item name="android:windowContentOverlay">@null</item>
diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml
index a10d234..ab630d2 100644
--- a/res/values-sw580dp/dimens.xml
+++ b/res/values-sw580dp/dimens.xml
@@ -23,6 +23,8 @@
<dimen name="editor_field_top_padding">12dip</dimen>
<dimen name="editor_field_bottom_padding">12dip</dimen>
<dimen name="detail_item_side_margin">0dip</dimen>
+ <dimen name="detail_item_vertical_margin">16dip</dimen>
+ <dimen name="detail_item_icon_margin">8dip</dimen>
<dimen name="contact_name_text_size">26sp</dimen>
<dimen name="action_bar_filter_min_width">120dip</dimen>
<dimen name="action_bar_filter_max_width">120dip</dimen>
diff --git a/res/values-sw580dp/donottranslate_config.xml b/res/values-sw580dp/donottranslate_config.xml
index 3d515eb..57db36b 100644
--- a/res/values-sw580dp/donottranslate_config.xml
+++ b/res/values-sw580dp/donottranslate_config.xml
@@ -21,4 +21,6 @@
<bool name="config_use_two_panes">true</bool>
<bool name="show_home_icon">true</bool>
<bool name="config_show_group_action_in_action_bar">false</bool>
+ <item name="tab_width_screen_width_percentage" type="fraction">66%</item>
+ <item name="tab_height_screen_width_percentage" type="fraction">66%</item>
</resources>
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index cf4c4ee..256683a 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -16,6 +16,8 @@
<resources>
<style name="PeopleTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
+ <item name="android:textColorPrimary">@color/primary_text_color</item>
+ <item name="android:textColorSecondary">@color/secondary_text_color</item>
<item name="list_item_height">66dip</item>
<item name="activated_background">@drawable/list_item_activated_background</item>
<item name="android:windowContentOverlay">@null</item>
@@ -103,17 +105,6 @@
<item name="android:windowIsFloating">true</item>
</style>
- <style name="ContactDetailItemType">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">match_parent</item>
- <item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
- <item name="android:textColor">?android:attr/textColorTertiary</item>
- <item name="android:singleLine">true</item>
- <item name="android:ellipsize">marquee</item>
- <item name="android:gravity">center_vertical</item>
- <item name="android:paddingTop">5dip</item>
- </style>
-
<style name="GroupBrowseListItem">
<item name="android:background">@drawable/list_item_activated_background</item>
</style>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index b6b3f31..552d47b 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -85,6 +85,12 @@
<!-- Color of the theme of the People app -->
<color name="people_app_theme_color">#33B5E5</color>
+ <!-- Primary text color in the People app -->
+ <color name="primary_text_color">#333333</color>
+
+ <!-- Secondary text color in the People app -->
+ <color name="secondary_text_color">#777777</color>
+
<!-- Colors in the contact browser list -->
<color name="contact_browser_list_bk_color">#EEEEEE</color>
<color name="contact_count_text_color">#777777</color>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 569f00b..a4a6112 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -173,6 +173,9 @@
<!-- Border padding for the group list header for each account -->
<dimen name="group_list_header_padding">5dip</dimen>
+ <!-- Size of group list icons -->
+ <dimen name="group_list_icon_size">32dip</dimen>
+
<!-- Border padding for the group detail fragment header -->
<dimen name="group_detail_border_padding">20dip</dimen>
diff --git a/res/values/donottranslate_config.xml b/res/values/donottranslate_config.xml
index 6a4ea62..0da6485 100644
--- a/res/values/donottranslate_config.xml
+++ b/res/values/donottranslate_config.xml
@@ -112,4 +112,12 @@
shown. Otherwise it will be part of the content on the group detail page.
-->
<bool name="config_show_group_action_in_action_bar">false</bool>
+
+ <!-- Width of a tab in the tab carousel as a percentage of the current screen width on the
+ contact detail page -->
+ <item name="tab_width_screen_width_percentage" type="fraction">75%</item>
+
+ <!-- Height of the tab carousel as a percentage of the current screen width on the
+ contact detail page -->
+ <item name="tab_height_screen_width_percentage" type="fraction">50%</item>
</resources>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index e267a19..58374ce 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -76,6 +76,8 @@
<style name="ContactDetailActivityTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
<item name="android:windowContentOverlay">@null</item>
+ <item name="android:textColorPrimary">@color/primary_text_color</item>
+ <item name="android:textColorSecondary">@color/secondary_text_color</item>
</style>
<style name="ContactEditorActivityTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
@@ -117,6 +119,8 @@
<style name="PeopleTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
+ <item name="android:textColorPrimary">@color/primary_text_color</item>
+ <item name="android:textColorSecondary">@color/secondary_text_color</item>
<item name="list_item_height">?android:attr/listPreferredItemHeight</item>
<item name="activated_background">@drawable/list_item_activated_background</item>
<item name="section_header_background">@drawable/list_title_holo</item>
@@ -154,6 +158,8 @@
<!-- TODO: Clean up this file so themes aren't copied. -->
<style name="GroupDetailTheme" parent="@android:style/Theme.Holo.Light.SolidActionBar.Inverse.SplitActionBarWhenNarrow">
<item name="android:actionBarStyle">@style/ContactsActionBarStyle</item>
+ <item name="android:textColorPrimary">@color/primary_text_color</item>
+ <item name="android:textColorSecondary">@color/secondary_text_color</item>
<item name="list_item_height">?android:attr/listPreferredItemHeight</item>
<item name="activated_background">@drawable/list_item_activated_background</item>
<item name="section_header_background">@drawable/list_title_holo</item>
@@ -238,17 +244,14 @@
</style>
<style name="ContactDetailItemType">
- <item name="android:layout_width">wrap_content</item>
- <item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">?android:attr/textAppearanceSmall</item>
- <item name="android:textColor">?android:attr/textColorTertiary</item>
+ <item name="android:textColor">?android:attr/textColorSecondary</item>
<item name="android:singleLine">true</item>
<item name="android:ellipsize">marquee</item>
- <item name="android:gravity">center_vertical</item>
+ <item name="android:layout_gravity">center_vertical</item>
</style>
<style name="GroupBrowseListItem">
- <item name="android:paddingRight">20dip</item>
</style>
<style name="DialtactsDigitsTextAppearance">
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index c3b2de6..f550a0f 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -1990,7 +1990,8 @@
R.dimen.detail_item_side_margin);
mPaddingTop = resources.getDimensionPixelSize(
R.dimen.detail_item_vertical_margin);
- mWidePaddingLeft = 2 * mPaddingLeft +
+ mWidePaddingLeft = mPaddingLeft +
+ resources.getDimensionPixelSize(R.dimen.detail_item_icon_margin) +
resources.getDimensionPixelSize(R.dimen.detail_network_icon_size);
mPaddingRight = mPaddingLeft;
mPaddingBottom = mPaddingTop;
diff --git a/src/com/android/contacts/detail/ContactDetailTabCarousel.java b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
index 4ef4b1c..cc4f0ff 100644
--- a/src/com/android/contacts/detail/ContactDetailTabCarousel.java
+++ b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
@@ -42,7 +42,11 @@
private static final int TAB_INDEX_UPDATES = 1;
private static final int TAB_COUNT = 2;
- private static final double TAB_WIDTH_SCREEN_PERCENTAGE = 0.75;
+ /** Tab width as defined as a fraction of the screen width */
+ private float mTabWidthScreenWidthFraction;
+
+ /** Tab height as defined as a fraction of the screen width */
+ private float mTabHeightScreenWidthFraction;
private ImageView mPhotoView;
private TextView mStatusView;
@@ -82,6 +86,10 @@
Resources resources = mContext.getResources();
mTabDisplayLabelHeight = resources.getDimensionPixelSize(
R.dimen.detail_tab_carousel_tab_label_height);
+ mTabWidthScreenWidthFraction = resources.getFraction(
+ R.fraction.tab_width_screen_width_percentage, 1, 1);
+ mTabHeightScreenWidthFraction = resources.getFraction(
+ R.fraction.tab_height_screen_width_percentage, 1, 1);
}
@Override
@@ -115,13 +123,13 @@
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
int screenWidth = MeasureSpec.getSize(widthMeasureSpec);
// Compute the width of a tab as a fraction of the screen width
- int tabWidth = (int) (TAB_WIDTH_SCREEN_PERCENTAGE * screenWidth);
+ int tabWidth = (int) (mTabWidthScreenWidthFraction * screenWidth);
// Find the allowed scrolling length by subtracting the current visible screen width
// from the total length of the tabs.
mAllowedHorizontalScrollLength = tabWidth * TAB_COUNT - screenWidth;
- int tabHeight = screenWidth / 2;
+ int tabHeight = (int) (screenWidth * mTabHeightScreenWidthFraction);
// Set the child {@link LinearLayout} to be TAB_COUNT * the computed tab width so that the
// {@link LinearLayout}'s children (which are the tabs) will evenly split that width.
if (getChildCount() > 0) {
diff --git a/src/com/android/contacts/group/GroupBrowseListAdapter.java b/src/com/android/contacts/group/GroupBrowseListAdapter.java
index 630a397..1f06029 100644
--- a/src/com/android/contacts/group/GroupBrowseListAdapter.java
+++ b/src/com/android/contacts/group/GroupBrowseListAdapter.java
@@ -16,33 +16,159 @@
package com.android.contacts.group;
+import com.android.contacts.ContactPhotoManager;
import com.android.contacts.GroupListLoader;
import com.android.contacts.R;
import com.android.contacts.model.AccountType;
import com.android.contacts.model.AccountTypeManager;
-import com.android.contacts.model.AccountWithDataSet;
import com.android.internal.util.Objects;
+import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
+import android.os.AsyncTask;
+import android.provider.ContactsContract.CommonDataKinds.GroupMembership;
+import android.provider.ContactsContract.Data;
import android.provider.ContactsContract.Groups;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
+import android.widget.ImageView;
import android.widget.TextView;
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
/**
* Adapter to populate the list of groups.
*/
public class GroupBrowseListAdapter extends BaseAdapter {
+ private static final int MAX_ICONS_PER_GROUP_ROW = 4;
+
+ private static final String[] PROJECTION_GROUP_MEMBERSHIP_INFO = new String[] {
+ GroupMembership._ID,
+ GroupMembership.PHOTO_ID
+ };
+ private static final int GROUP_MEMBERSHIP_COLUMN_PHOTO_ID = 1;
+
+ /**
+ * Arguments for asynchronous photo ID loading. See {@link AsyncPhotoIdLoadTask}
+ */
+ private static class AsyncPhotoIdLoadArg {
+ public final View icons;
+ public final long groupId;
+ public final Map<Long, ArrayList<Long>> groupPhotoIdMap;
+ public final ContentResolver contentResolver;
+ public final ContactPhotoManager contactPhotoManager;
+
+ public AsyncPhotoIdLoadArg(
+ View icons, long groupId, Map<Long, ArrayList<Long>> groupPhotoIdMap,
+ ContentResolver contentResolver, ContactPhotoManager contactPhotoManager) {
+ this.icons = icons;
+ this.groupId = groupId;
+ this.groupPhotoIdMap = groupPhotoIdMap;
+ this.contentResolver = contentResolver;
+ this.contactPhotoManager = contactPhotoManager;
+ }
+ }
+
+ /**
+ * Loads photo IDs associated with a group ID supplied from {@link AsyncPhotoIdLoadArg#groupId},
+ * storing them in {@link GroupBrowseListAdapter#mGroupPhotoIdMap}.
+ *
+ * This AsyncTask also remembers a View which is associated with the group ID at the moment it
+ * is initiated (we use {@link View#setTag(Object) and View#getTag() to associate them}. If the
+ * View is still associated with the group ID after the asynchronous photo ID load, this class
+ * also asks {@link ContactPhotoManager} to load actual photo contents. Its parent (typically
+ * ListView) may reuse Views for different group IDs, so the photo content load often don't
+ * occur.
+ */
+ private static class AsyncPhotoIdLoadTask extends
+ AsyncTask<AsyncPhotoIdLoadArg, Void, ArrayList<Long>> {
+
+ private View mIcons;
+ private long mGroupId;
+ private Map<Long, ArrayList<Long>> mGroupPhotoIdMap;
+ private ContentResolver mContentResolver;
+ private ContactPhotoManager mContactPhotoManager;
+
+ @Override
+ protected ArrayList<Long> doInBackground(AsyncPhotoIdLoadArg... params) {
+ final AsyncPhotoIdLoadArg arg = params[0];
+ mIcons = arg.icons;
+ mGroupId = arg.groupId;
+ mGroupPhotoIdMap = arg.groupPhotoIdMap;
+ mContentResolver = arg.contentResolver;
+ mContactPhotoManager = arg.contactPhotoManager;
+
+ // Multiple requests for one group ID is possible. We just ignore duplicates,
+ // assuming query results won't change.
+ if (mGroupPhotoIdMap.containsKey(mGroupId)) {
+ return null;
+ }
+
+ final ArrayList<Long> photoIds = new ArrayList<Long>(MAX_ICONS_PER_GROUP_ROW);
+ Cursor cursor = null;
+ try {
+ cursor = mContentResolver.query(Data.CONTENT_URI,
+ PROJECTION_GROUP_MEMBERSHIP_INFO,
+ GroupMembership.MIMETYPE + "=? AND "
+ + GroupMembership.PHOTO_ID + " IS NOT NULL AND "
+ + GroupMembership.GROUP_ROW_ID + "=?",
+ new String[] { GroupMembership.CONTENT_ITEM_TYPE,
+ String.valueOf(mGroupId) }, null);
+ if (cursor != null) {
+ int count = 0;
+ while (cursor.moveToNext() && count < MAX_ICONS_PER_GROUP_ROW) {
+ photoIds.add(cursor.getLong(GROUP_MEMBERSHIP_COLUMN_PHOTO_ID));
+ count++;
+ }
+ }
+ } finally {
+ if (cursor != null) {
+ cursor.close();
+ }
+ }
+ return photoIds;
+ }
+
+ @Override
+ protected void onPostExecute(ArrayList<Long> photoIds) {
+ if (photoIds == null) {
+ return;
+ }
+
+ mGroupPhotoIdMap.put(mGroupId, photoIds);
+
+ final View icons = mIcons;
+ // If the original group ID, which was supplied when this AsyncTask was executed, is
+ // consistent with the ID inside mArgs, it means the View isn't reused by the
+ // other groups, and thus we can assume these Views are available for the group ID.
+ final Long currentGroupId = (Long) icons.getTag();
+ if (currentGroupId == mGroupId) {
+ final ImageView[] children = getIconViewsSordedByFillOrder(icons);
+ for (int i = 0; i < children.length; i++) {
+ final long photoId = i < photoIds.size() ? photoIds.get(i) : 0;
+ mContactPhotoManager.loadPhoto(children[i], photoId);
+ }
+ }
+ }
+ }
+
private final Context mContext;
private final LayoutInflater mLayoutInflater;
private final AccountTypeManager mAccountTypeManager;
+ private final Map<Long, ArrayList<Long>> mGroupPhotoIdMap =
+ new ConcurrentHashMap<Long, ArrayList<Long>>();
+
+ private final ContactPhotoManager mContactPhotoManager;
+
private Cursor mCursor;
private boolean mSelectionVisible;
@@ -52,6 +178,7 @@
mContext = context;
mLayoutInflater = LayoutInflater.from(context);
mAccountTypeManager = AccountTypeManager.getInstance(mContext);
+ mContactPhotoManager = ContactPhotoManager.getInstance(mContext);
}
public void setCursor(Cursor cursor) {
@@ -179,6 +306,32 @@
viewCache.groupTitle.setText(entry.getTitle());
viewCache.groupMemberCount.setText(memberCountString);
+ final View icons = result.findViewById(R.id.icons);
+ final ImageView[] children = getIconViewsSordedByFillOrder(icons);
+ final ArrayList<Long> photoIds = mGroupPhotoIdMap.get(entry.getGroupId());
+
+ // Let the icon holder remember its associated group ID.
+ // Each AsyncTask loading photo IDs will compare this ID with the AsyncTask's argument, and
+ // check if the bound View is reused by the other list items or not. If the View is reused,
+ // the group ID set here will be overridden by the new owner, thus ID inconsistency happens.
+ icons.setTag(entry.getGroupId());
+ if (photoIds != null) {
+ // Cache is available. Let the photo manager load those IDs.
+ for (int i = 0; i < children.length; i++) {
+ final long photoId = i < photoIds.size() ? photoIds.get(i) : 0;
+ mContactPhotoManager.loadPhoto(children[i], photoId);
+ }
+ } else {
+ // Cache is not available. Load photo IDs asynchronously.
+ for (ImageView child : children) {
+ mContactPhotoManager.loadPhoto(child, 0);
+ }
+ new AsyncPhotoIdLoadTask().execute(
+ new AsyncPhotoIdLoadArg(icons, entry.getGroupId(),
+ mGroupPhotoIdMap, mContext.getContentResolver(),
+ mContactPhotoManager));
+ }
+
if (mSelectionVisible) {
result.setActivated(isSelectedGroup(groupUri));
}
@@ -201,6 +354,19 @@
}
/**
+ * Get ImageView objects inside the given View, sorted by the order photos should be filled.
+ */
+ private static ImageView[] getIconViewsSordedByFillOrder(View icons) {
+ final ImageView[] children = new ImageView[] {
+ (ImageView) icons.findViewById(R.id.icon_4),
+ (ImageView) icons.findViewById(R.id.icon_2),
+ (ImageView) icons.findViewById(R.id.icon_3),
+ (ImageView) icons.findViewById(R.id.icon_1)
+ };
+ return children;
+ }
+
+ /**
* Cache of the children views of a contact detail entry represented by a
* {@link GroupListItem}
*/