Contact picker/group list pixel-perfect
There are still a few issues to be fixed around picker
stuff, but it looks basically fine enough.
- fix misc padding issues around contact listing itself
- introduce conditional padding for phone search view to keep
top padding consistency
- keep consistency between group and contact listing
- remove "groups per account" count
- stop showing quick scroll bar in group list
Bug: 5137457
Bug: 5144140
Bug: 5143350
Bug: 5080599
Change-Id: I038c112bbf9e956e9a2b784178c0360d03e3f333
diff --git a/res/layout-sw580dp/contact_picker_content.xml b/res/layout-sw580dp/contact_picker_content.xml
deleted file mode 100644
index 225b725..0000000
--- a/res/layout-sw580dp/contact_picker_content.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2008 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <View
- android:layout_width="match_parent"
- android:layout_height="2dip"
- android:layout_marginTop="1dip"
- android:layout_marginBottom="1dip"
- android:background="#7e7e87" />
-
- <view
- class="com.android.contacts.list.ContactEntryListView"
- android:id="@android:id/list"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:fastScrollEnabled="true"
- android:layout_weight="1"/>
-
- <ViewStub
- android:id="@+id/footer_stub"
- android:layout="@layout/footer_panel"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content" />
-</LinearLayout>
diff --git a/res/layout/contact_detail_list_item.xml b/res/layout/contact_detail_list_item.xml
index ccfa01d..e292f39 100644
--- a/res/layout/contact_detail_list_item.xml
+++ b/res/layout/contact_detail_list_item.xml
@@ -24,8 +24,8 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
- android:paddingTop="12dip"
- android:paddingBottom="12dip"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip"
android:minHeight="@dimen/detail_min_line_item_height">
<!-- Note: padding might be controlled programatically -->
diff --git a/res/layout/contact_detail_list_padding.xml b/res/layout/contact_detail_list_padding.xml
new file mode 100644
index 0000000..8095731
--- /dev/null
+++ b/res/layout/contact_detail_list_padding.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2011 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- The actual padding is embedded in a FrameLayout since we cannot change the
+ visibility of a header view in a ListView without having a parent view. -->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <View
+ android:id="@+id/contact_detail_list_padding"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/contact_browser_list_top_margin" />
+</FrameLayout>
+
diff --git a/res/layout/contact_picker.xml b/res/layout/contact_picker.xml
index c3fe2fa..96bf334 100644
--- a/res/layout/contact_picker.xml
+++ b/res/layout/contact_picker.xml
@@ -18,8 +18,6 @@
xmlns:android="http://schemas.android.com/apk/res/android"
class="com.android.contacts.widget.FullHeightLinearLayout"
style="@style/ContactPickerLayout"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
android:orientation="vertical"
android:layout_height="match_parent">
<view
@@ -27,18 +25,18 @@
android:id="@+id/search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="10dip"
- android:layout_marginRight="10dip"
- android:layout_marginBottom="10dip"
+ android:layout_marginLeft="0dip"
+ android:layout_marginRight="32dip"
android:iconifiedByDefault="false" />
+ <!-- will contain an appropriate contacts list -->
<FrameLayout
+ android:id="@+id/list_container"
android:layout_width="match_parent"
android:layout_height="0dip"
- android:layout_weight="1"
- android:id="@+id/list_container">
- </FrameLayout>
+ android:layout_weight="1" />
<View
+ android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dip"
android:layout_marginLeft="16dip"
@@ -48,7 +46,9 @@
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip">
<Button
style="?android:attr/buttonBarButtonStyle"
android:id="@+id/cancel"
diff --git a/res/layout/contact_picker_content.xml b/res/layout/contact_picker_content.xml
index 6792f9c..c30add7 100644
--- a/res/layout/contact_picker_content.xml
+++ b/res/layout/contact_picker_content.xml
@@ -26,6 +26,8 @@
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="0dip"
+ android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+ android:layout_marginRight="?attr/contact_browser_list_padding_right"
android:fastScrollEnabled="true"
android:layout_weight="1" />
diff --git a/res/layout/contacts_list_content.xml b/res/layout/contacts_list_content.xml
index f98d751..66c3936 100644
--- a/res/layout/contacts_list_content.xml
+++ b/res/layout/contacts_list_content.xml
@@ -22,17 +22,19 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pinned_header_list_layout"
- android:paddingTop="@dimen/contact_browser_list_top_margin"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
- <!-- Shown only when an Account filter is set. -->
+ <!-- Shown only when an Account filter is set.
+ - paddingTop should be here to show "shade" effect correctly. -->
<LinearLayout
android:id="@+id/account_filter_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:minHeight="?attr/list_item_header_height"
android:orientation="vertical"
+ android:paddingTop="@dimen/contact_browser_list_top_margin"
android:layout_marginLeft="@dimen/contact_browser_list_header_left_margin"
android:layout_marginRight="@dimen/contact_browser_list_header_right_margin"
android:visibility="gone">
@@ -40,11 +42,9 @@
android:id="@+id/account_filter_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="@dimen/contact_filter_header_min_height"
android:singleLine="true"
android:ellipsize="end"
android:textStyle="bold"
- android:gravity="left|center_vertical"
android:textAllCaps="true"
android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
android:textAppearance="?android:attr/textAppearanceSmall"
@@ -59,9 +59,9 @@
class="com.android.contacts.list.ContactEntryListView"
android:id="@android:id/list"
android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_marginLeft="@dimen/contact_browser_list_left_margin"
- android:layout_marginRight="@dimen/contact_browser_list_right_margin"
+ android:layout_height="0dip"
+ android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+ android:layout_marginRight="?attr/contact_browser_list_padding_right"
android:fastScrollEnabled="true"
android:layout_weight="1" />
diff --git a/res/layout/directory_header.xml b/res/layout/directory_header.xml
index af0b5bd..6043c7b 100644
--- a/res/layout/directory_header.xml
+++ b/res/layout/directory_header.xml
@@ -19,12 +19,14 @@
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/DirectoryHeader"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:minHeight="?attr/list_item_header_height"
+ android:paddingLeft="?attr/list_item_padding_left"
+ android:paddingRight="?attr/list_item_padding_right">
<TextView
android:id="@+id/display_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:minHeight="@dimen/directory_header_height"
android:layout_toRightOf="@+id/label"
android:layout_toLeftOf="@+id/count"
android:layout_centerVertical="true"
@@ -32,7 +34,9 @@
android:layout_marginRight="8dip"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
- android:singleLine="true" />
+ android:singleLine="true"
+ android:textStyle="bold"
+ android:textAllCaps="true" />
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
@@ -41,16 +45,19 @@
android:layout_alignBaseline="@id/display_name"
android:layout_marginLeft="8dip"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary" />
+ android:textColor="?android:attr/textColorSecondary"
+ android:singleLine="true"
+ android:textStyle="bold"
+ android:textAllCaps="true" />
<TextView
android:id="@+id/count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
- android:layout_marginRight="8dip"
android:layout_alignBaseline="@id/display_name"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary" />
+ android:singleLine="true"
+ android:textSize="12sp"
+ android:textColor="@color/contact_count_text_color" />
<View
android:id="@+id/contact_filter_header_bottom_divider"
style="@style/SectionDivider"
diff --git a/res/layout/group_browse_list_account_header.xml b/res/layout/group_browse_list_account_header.xml
index f739ea2..b1d873d 100644
--- a/res/layout/group_browse_list_account_header.xml
+++ b/res/layout/group_browse_list_account_header.xml
@@ -18,54 +18,43 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:background="@drawable/list_background_holo"
- android:paddingLeft="@dimen/group_list_header_padding"
- android:paddingRight="@dimen/group_list_header_padding"
- android:paddingTop="@dimen/group_list_header_padding"
+ android:minHeight="?attr/list_item_header_height"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingLeft="?attr/list_item_header_text_indent"
android:orientation="horizontal">
<TextView
android:id="@+id/account_type"
- android:layout_width="wrap_content"
+ android:layout_width="0px"
android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_weight="1"
+ android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/people_app_theme_color"
android:textStyle="bold"
android:textAllCaps="true"
android:singleLine="true"/>
+ <!-- TODO: Shold use correct color with a correct name (content should be same).
+ can use "?android:attr/textColorTertiary" -->
<TextView
android:id="@+id/account_name"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_marginLeft="@dimen/group_list_header_padding"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:singleLine="true"
- android:ellipsize="middle"
- android:textColor="@color/people_app_theme_color"/>
-
- <TextView
- android:id="@+id/group_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:gravity="right"
- android:singleLine="true"
- android:layout_marginLeft="@dimen/group_list_header_padding"
+ android:layout_gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"/>
-
+ android:textColor="@color/contact_count_text_color"
+ android:textSize="12sp"
+ android:singleLine="true"
+ android:ellipsize="middle" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dip"
- android:layout_marginTop="@dimen/group_list_header_padding"
- android:background="@color/people_app_theme_color"/>
+ android:background="@color/people_app_theme_color" />
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/layout/group_browse_list_fragment.xml b/res/layout/group_browse_list_fragment.xml
index 9e6bd27..6e82e8f 100644
--- a/res/layout/group_browse_list_fragment.xml
+++ b/res/layout/group_browse_list_fragment.xml
@@ -25,20 +25,23 @@
class="com.android.contacts.widget.AutoScrollListView"
android:layout_width="match_parent"
android:layout_height="0dip"
- android:fastScrollEnabled="true"
+ android:paddingTop="@dimen/contact_browser_list_top_margin"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
android:scrollbarStyle="outsideOverlay"
android:layout_weight="1"
android:cacheColorHint="@android:color/transparent"
android:divider="@null" />
<TextView
- android:id="@+id/empty"
- android:layout_marginTop="@dimen/empty_message_top_margin"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:text="@string/noGroups" />
+ android:id="@+id/empty"
+ android:layout_marginTop="@dimen/empty_message_top_margin"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="8dip"
+ android:gravity="center_horizontal"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:text="@string/noGroups" />
<LinearLayout
android:id="@+id/add_accounts"
diff --git a/res/layout/group_browse_list_item.xml b/res/layout/group_browse_list_item.xml
index 326b413..599cc13 100644
--- a/res/layout/group_browse_list_item.xml
+++ b/res/layout/group_browse_list_item.xml
@@ -19,35 +19,33 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:minHeight="@dimen/detail_min_line_item_height">
+ android:paddingLeft="?attr/list_item_padding_left"
+ android:paddingTop="?attr/list_item_padding_top"
+ android:paddingRight="?attr/list_item_padding_right"
+ android:paddingBottom="?attr/list_item_padding_bottom"
+ android:minHeight="@dimen/detail_min_line_item_height" >
- <ImageView
+ <View
android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dip"
- android:paddingLeft="10dip"
- android:paddingRight="10dip"
- android:scaleType="fitXY"
- android:src="@color/people_app_theme_color"/>
+ android:background="?android:attr/listDivider" />
<include
android:id="@+id/group_list_header"
layout="@layout/group_browse_list_account_header"
- android:paddingRight="20dip"
- android:paddingBottom="10dip"
android:visibility="gone" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingTop="10dip"
- android:paddingRight="20dip"
- android:paddingBottom="10dip"
- style="@style/GroupBrowseListItem">
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingLeft="?attr/list_item_text_indent"
android:orientation="vertical"
android:layout_toLeftOf="@+id/icons"
android:layout_alignParentLeft="true"
@@ -57,8 +55,6 @@
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" />
@@ -67,8 +63,6 @@
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"
diff --git a/res/layout/join_contact_picker.xml b/res/layout/join_contact_picker.xml
index 20a7740..ffea137 100644
--- a/res/layout/join_contact_picker.xml
+++ b/res/layout/join_contact_picker.xml
@@ -24,20 +24,22 @@
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1"
- android:id="@+id/list_container">
- </FrameLayout>
+ android:id="@+id/list_container" />
<View
+ android:id="@+id/divider"
android:layout_width="match_parent"
android:layout_height="1dip"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="16dip"
+ android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+ android:layout_marginRight="?attr/contact_browser_list_padding_right"
android:background="?android:attr/dividerHorizontal" />
<LinearLayout
style="?android:attr/buttonBarStyle"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+ android:layout_marginRight="?attr/contact_browser_list_padding_right">
<Button
style="?android:attr/buttonBarButtonStyle"
android:id="@+id/cancel"
diff --git a/res/layout/join_contact_picker_list_content.xml b/res/layout/join_contact_picker_list_content.xml
index 0d2a089..9e72c31 100644
--- a/res/layout/join_contact_picker_list_content.xml
+++ b/res/layout/join_contact_picker_list_content.xml
@@ -19,33 +19,30 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:paddingTop="8dip"
android:orientation="vertical">
<TextView
android:id="@+id/join_contact_blurb"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="10dip"
- android:paddingTop="12dip"
- android:paddingBottom="12dip"
- android:layout_marginLeft="12dip"
- android:layout_marginRight="12dip"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
android:maxLines="2"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary" />
+ android:textAppearance="?android:attr/textAppearanceMedium" />
<FrameLayout
android:id="@+id/pinned_header_list_layout"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginLeft="48dip"
- android:layout_marginRight="48dip">
-
+ android:layout_height="match_parent">
<view
class="com.android.contacts.list.ContactEntryListView"
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:fastScrollEnabled="true" />
+ android:layout_marginLeft="?attr/contact_browser_list_padding_left"
+ android:layout_marginRight="?attr/contact_browser_list_padding_right"
+ android:fastScrollEnabled="true"
+ android:scrollbarStyle="outsideOverlay" />
</FrameLayout>
</LinearLayout>
diff --git a/res/layout/join_contact_picker_section.xml b/res/layout/join_contact_picker_section.xml
index 95ec107..260ea2d 100644
--- a/res/layout/join_contact_picker_section.xml
+++ b/res/layout/join_contact_picker_section.xml
@@ -22,12 +22,12 @@
<TextView
android:id="@+id/text"
- android:layout_height="32dip"
android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingLeft="?attr/list_item_header_text_indent"
+ android:minHeight="16dip"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
android:gravity="center_vertical" />
- <View
- style="@style/SectionDivider" />
+ <View style="@style/SectionDivider" />
</LinearLayout>
diff --git a/res/layout/user_profile_button.xml b/res/layout/user_profile_button.xml
index 4937d7b..8735f5a 100644
--- a/res/layout/user_profile_button.xml
+++ b/res/layout/user_profile_button.xml
@@ -18,11 +18,13 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+ android:minHeight="@dimen/contact_browser_list_item_photo_size"
+ android:layout_marginLeft="?attr/list_item_padding_left"
+ android:layout_marginRight="?attr/list_item_padding_right"
+ android:paddingLeft="?attr/list_item_header_text_indent"
android:background="?android:attr/selectableItemBackground"
android:singleLine="true"
android:text="@string/profile_display_name"
android:ellipsize="end"
- android:minHeight="@dimen/contact_browser_list_item_photo_size"
android:gravity="left|center_vertical"
- android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
android:textAppearance="?android:attr/textAppearanceMedium" />
diff --git a/res/layout/user_profile_header.xml b/res/layout/user_profile_header.xml
index 7c82ea4..ff01a11 100644
--- a/res/layout/user_profile_header.xml
+++ b/res/layout/user_profile_header.xml
@@ -16,15 +16,19 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- android:paddingTop="@dimen/contact_browser_list_top_margin"
+ android:id="@+id/user_profile_header"
android:orientation="vertical"
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content"
+ android:minHeight="?attr/list_item_header_height"
+ android:paddingTop="@dimen/contact_browser_list_top_margin"
+ android:paddingLeft="?attr/list_item_padding_left"
+ android:paddingRight="?attr/list_item_padding_right" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
- android:layout_height="wrap_content" >
+ android:layout_height="wrap_content">
<TextView
android:id="@+id/profile_title"
@@ -37,7 +41,7 @@
android:gravity="left|center_vertical"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:paddingLeft="@dimen/contact_browser_list_item_text_indent"
+ android:paddingLeft="?attr/list_item_text_indent"
android:textColor="@color/people_app_theme_color" />
<TextView
@@ -55,6 +59,6 @@
<View
android:background="@color/people_app_theme_color"
android:layout_width="match_parent"
- android:layout_height="1dip" />
+ android:layout_height="?attr/list_item_header_underline_height" />
-</LinearLayout>
\ No newline at end of file
+</LinearLayout>
diff --git a/res/values-sw580dp-w720dp/styles.xml b/res/values-sw580dp-w720dp/styles.xml
index ff50d45..4314c80 100644
--- a/res/values-sw580dp-w720dp/styles.xml
+++ b/res/values-sw580dp-w720dp/styles.xml
@@ -37,10 +37,16 @@
<item name="list_item_prefix_highlight_color">#729a27</item>
<item name="list_item_header_text_indent">8dip</item>
<item name="list_item_header_text_color">@color/people_app_theme_color</item>
- <item name="list_item_header_height">26dip</item>
+ <item name="list_item_header_height">24dip</item>
<item name="list_item_header_text_size">14sp</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+ <item name="list_item_header_underline_height">1dip</item>
+ <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+ <item name="list_item_contacts_count_text_size">12sp</item>
<item name="contact_filter_popup_width">320dip</item>
+ <item name="contact_browser_list_padding_left">0dip</item>
+ <item name="contact_browser_list_padding_right">0dip</item>
+ <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
<!-- Favorites -->
<item name="favorites_padding_bottom">0dip</item>
</style>
diff --git a/res/values-sw580dp/dimens.xml b/res/values-sw580dp/dimens.xml
index 91842d6..af253f3 100644
--- a/res/values-sw580dp/dimens.xml
+++ b/res/values-sw580dp/dimens.xml
@@ -42,7 +42,5 @@
<dimen name="contact_browser_list_top_margin">16dip</dimen>
<dimen name="contact_browser_list_header_left_margin">@dimen/list_visible_scrollbar_padding</dimen>
<dimen name="contact_browser_list_header_right_margin">24dip</dimen>
- <dimen name="contact_browser_list_left_margin">0dip</dimen>
- <dimen name="contact_browser_list_right_margin">0dip</dimen>
<dimen name="list_visible_scrollbar_padding">48dip</dimen>
</resources>
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index a386e57..efbbde2 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -19,7 +19,7 @@
<item name="android:actionBarTabStyle">@style/ContactsActionBarTabView</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="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>
<item name="list_item_divider">?android:attr/listDivider</item>
@@ -40,29 +40,51 @@
<item name="list_item_header_text_color">@color/people_app_theme_color</item>
<item name="list_item_header_height">26dip</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+ <item name="list_item_header_underline_height">1dip</item>
+ <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+ <item name="list_item_contacts_count_text_size">12sp</item>
<item name="contact_filter_popup_width">320dip</item>
+ <item name="contact_browser_list_padding_left">0dip</item>
+ <item name="contact_browser_list_padding_right">0dip</item>
+ <item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
<!-- Favorites -->
<item name="favorites_padding_bottom">0dip</item>
</style>
<style name="ContactPickerTheme" parent="@android:Theme.Holo.Light.Dialog">
- <item name="list_item_height">66dip</item>
+ <item name="list_item_height">?android:attr/listPreferredItemHeight</item>
<item name="section_header_background">@drawable/list_title_holo</item>
<item name="list_item_divider">?android:attr/listDivider</item>
<item name="list_item_padding_top">0dip</item>
- <item name="list_item_padding_right">24dip</item>
+ <item name="list_item_padding_right">0dip</item>
<item name="list_item_padding_bottom">0dip</item>
<item name="list_item_padding_left">0dip</item>
- <item name="list_item_gap_between_image_and_text">16dip</item>
+ <item name="list_item_gap_between_image_and_text">8dip</item>
<item name="list_item_gap_between_label_and_data">5dip</item>
<item name="list_item_call_button_padding">14dip</item>
<item name="list_item_vertical_divider_margin">5dip</item>
- <item name="list_item_presence_icon_margin">30dip</item>
+ <item name="list_item_presence_icon_margin">18dip</item>
<item name="list_item_photo_size">64dip</item>
<item name="list_item_profile_photo_size">80dip</item>
- <item name="list_item_header_text_indent">77dip</item>
- <item name="list_item_header_text_color">?color/section_header_text_color</item>
+ <item name="list_item_header_text_indent">8dip</item>
<item name="list_item_header_text_size">14sp</item>
+ <item name="list_item_header_text_color">@color/people_app_theme_color</item>
+ <item name="list_item_header_height">24dip</item>
+ <item name="list_item_header_underline_color">@color/people_app_theme_color</item>
+ <item name="list_item_header_underline_height">1dip</item>
+ <item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+ <item name="list_item_contacts_count_text_size">12sp</item>
+ <item name="contact_filter_popup_width">320dip</item>
+ <item name="contact_browser_list_padding_left">16dip</item>
+ <item name="contact_browser_list_padding_right">0dip</item>
+ </style>
+ <style name="ContactPickerLayout" parent="ContactPickerTheme">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">480dip</item>
+ </style>
+ <style name="JoinContactActivityTheme" parent="ContactPickerTheme" >
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">480dip</item>
</style>
<style name="ContactListFilterTheme" parent="@android:Theme.Holo.Light.Dialog">
@@ -74,11 +96,6 @@
<item name="android:layout_height">400dip</item>
</style>
- <style name="ContactPickerLayout" parent="ContactPickerTheme">
- <item name="android:layout_width">480dip</item>
- <item name="android:layout_height">match_parent</item>
- </style>
-
<style name="ContactDetailActivityTheme" parent="@android:Theme.Dialog">
<item name="android:windowContentOverlay">@null</item>
</style>
@@ -86,7 +103,7 @@
<style name="DirectoryHeader" parent="PeopleTheme">
<item name="android:paddingTop">0dip</item>
<item name="android:paddingBottom">0dip</item>
- <item name="android:background">@drawable/directory_bg_holo</item>
+ <item name="android:background">@android:color/transparent</item>
</style>
<style name="NonPhoneDialogTheme" parent="@android:Theme.Holo.Light.Dialog">
@@ -102,8 +119,4 @@
<item name="android:windowNoDisplay">true</item>
<item name="android:windowIsFloating">true</item>
</style>
-
- <style name="GroupBrowseListItem">
- <item name="android:background">@drawable/list_item_activated_background</item>
- </style>
</resources>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 0f7b62d..7bec43a 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -68,6 +68,8 @@
<declare-styleable name="ContactBrowser">
<attr name="contact_filter_popup_width" format="dimension"/>
+ <attr name="contact_browser_list_padding_left" format="dimension"/>
+ <attr name="contact_browser_list_padding_right" format="dimension"/>
</declare-styleable>
<declare-styleable name="ContactListItemView">
diff --git a/res/values/colors.xml b/res/values/colors.xml
index a277124..1e47948 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -87,7 +87,6 @@
<color name="dialtacts_secondary_text_color">#888888</color>
<!-- Colors in the contact browser list -->
- <color name="contact_browser_list_bk_color">#EEEEEE</color>
<color name="contact_count_text_color">#AAAAAA</color>
<!-- Color of the text of the tab carousel in the contact details -->
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 69441fd..55fb5f3 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -210,8 +210,6 @@
<!-- contact browser list margins -->
<dimen name="contact_browser_list_header_left_margin">16dip</dimen>
<dimen name="contact_browser_list_header_right_margin">@dimen/list_visible_scrollbar_padding</dimen>
- <dimen name="contact_browser_list_left_margin">16dip</dimen>
- <dimen name="contact_browser_list_right_margin">0dip</dimen>
<dimen name="contact_browser_list_item_photo_size">64dip</dimen>
<dimen name="contact_browser_list_item_text_indent">8dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index d202a0f..84c3d15 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -42,9 +42,11 @@
<item name="list_item_header_text_color">@color/people_app_theme_color</item>
<item name="list_item_header_text_size">12sp</item>
<item name="list_item_header_height">24dip</item>
- <item name="list_item_header_underline_height">1px</item>
+ <item name="list_item_header_underline_height">1dip</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
<item name="contact_filter_popup_width">320dip</item>
+ <item name="contact_browser_list_padding_left">16dip</item>
+ <item name="contact_browser_list_padding_right">0dip</item>
<item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
<!-- CallLog -->
<item name="call_log_primary_text_color">#FFFFFF</item>
@@ -144,17 +146,18 @@
<item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
<item name="list_item_profile_photo_size">70dip</item>
<item name="list_item_prefix_highlight_color">#729a27</item>
- <item name="list_item_header_text_indent">@dimen/contact_browser_list_item_text_indent</item>
<item name="list_item_header_text_color">@color/people_app_theme_color</item>
<item name="list_item_header_text_size">14dip</item>
<item name="list_item_header_height">26dip</item>
<item name="list_item_header_underline_height">1dip</item>
<item name="list_item_header_underline_color">@color/people_app_theme_color</item>
<item name="list_item_contacts_count_text_color">@color/contact_count_text_color</item>
+ <item name="list_item_header_text_indent">8dip</item>
<item name="contact_filter_popup_width">320dip</item>
+ <item name="contact_browser_list_padding_left">16dip</item>
+ <item name="contact_browser_list_padding_right">0dip</item>
<item name="list_item_text_indent">@dimen/contact_browser_list_item_text_indent</item>
- <item name="list_item_contacts_count_text_size">12dip</item>
- list_item_contacts_count_text_size
+ <item name="list_item_contacts_count_text_size">12sp</item>
<!-- Favorites -->
<item name="favorites_padding_bottom">0dip</item>
</style>
@@ -190,30 +193,19 @@
<item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
<item name="list_item_profile_photo_size">70dip</item>
<item name="list_item_prefix_highlight_color">#729a27</item>
- <item name="list_item_header_text_indent">56dip</item>
<item name="list_item_header_text_color">?color/section_header_text_color</item>
<item name="list_item_header_text_size">14sp</item>
+ <item name="list_item_header_text_indent">8dip</item>
<item name="contact_filter_popup_width">320dip</item>
+ <item name="contact_browser_list_padding_left">16dip</item>
+ <item name="contact_browser_list_padding_right">0dip</item>
</style>
- <style name="ContactPickerTheme" parent="@android:Theme.Holo.Light">
- <item name="section_header_background">@drawable/section_header</item>
- <item name="list_item_divider">?android:attr/listDivider</item>
- <item name="list_item_padding_top">4dip</item>
- <item name="list_item_padding_right">11dip</item>
- <item name="list_item_padding_bottom">4dip</item>
- <item name="list_item_padding_left">4dip</item>
- <item name="list_item_gap_between_image_and_text">8dip</item>
- <item name="list_item_gap_between_label_and_data">5dip</item>
- <item name="list_item_call_button_padding">14dip</item>
- <item name="list_item_vertical_divider_margin">5dip</item>
- <item name="list_item_presence_icon_margin">5dip</item>
- <item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
- <item name="list_item_profile_photo_size">70dip</item>
- <item name="list_item_prefix_highlight_color">#729a27</item>
- <item name="list_item_header_text_indent">56dip</item>
- <item name="list_item_header_text_color">?color/section_header_text_color</item>
- <item name="list_item_header_text_size">14sp</item>
+ <style name="ContactPickerTheme" parent="@style/PeopleTheme">
+ </style>
+ <style name="ContactPickerLayout" parent="ContactPickerTheme">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">match_parent</item>
</style>
<style name="JoinContactActivityTheme" parent="ContactPickerTheme" >
@@ -225,11 +217,6 @@
<style name="ContactListFilterTheme" parent="@android:Theme.Holo.Light">
</style>
- <style name="ContactPickerLayout" parent="ContactPickerTheme">
- <item name="android:layout_width">match_parent</item>
- <item name="android:layout_height">match_parent</item>
- </style>
-
<style name="CustomContactListFilterView" parent="ContactListFilterTheme">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
@@ -247,7 +234,7 @@
<style name="SectionDivider">
<item name="android:background">#7e7e87</item>
- <item name="android:layout_height">2dip</item>
+ <item name="android:layout_height">1dip</item>
<item name="android:layout_width">match_parent</item>
</style>
@@ -264,9 +251,6 @@
<item name="android:layout_gravity">center_vertical</item>
</style>
- <style name="GroupBrowseListItem">
- </style>
-
<style name="DialtactsDigitsTextAppearance">
<item name="android:maxLines">1</item>
<item name="android:scrollHorizontally">true</item>
diff --git a/src/com/android/contacts/GroupListLoader.java b/src/com/android/contacts/GroupListLoader.java
index 39c428f..b567ba8 100644
--- a/src/com/android/contacts/GroupListLoader.java
+++ b/src/com/android/contacts/GroupListLoader.java
@@ -37,7 +37,6 @@
Groups.ACTION,
Groups.ACTION_URI,
Groups.SUMMARY_COUNT,
- Groups.SUMMARY_GROUP_COUNT_PER_ACCOUNT,
};
public final static int ACCOUNT_NAME = 0;
@@ -48,10 +47,8 @@
public final static int ACTION = 5;
public final static int ACTION_URI = 6;
public final static int MEMBER_COUNT = 7;
- public final static int GROUP_COUNT_PER_ACCOUNT = 8;
- private static final Uri GROUP_LIST_URI = Groups.CONTENT_SUMMARY_URI.buildUpon()
- .appendQueryParameter(Groups.PARAM_RETURN_GROUP_COUNT_PER_ACCOUNT, "true").build();
+ private static final Uri GROUP_LIST_URI = Groups.CONTENT_SUMMARY_URI;
public GroupListLoader(Context context) {
super(context, GROUP_LIST_URI, COLUMNS, Groups.ACCOUNT_TYPE + " NOT NULL AND "
diff --git a/src/com/android/contacts/group/GroupBrowseListAdapter.java b/src/com/android/contacts/group/GroupBrowseListAdapter.java
index 6571b99..c8c16e6 100644
--- a/src/com/android/contacts/group/GroupBrowseListAdapter.java
+++ b/src/com/android/contacts/group/GroupBrowseListAdapter.java
@@ -253,7 +253,6 @@
long groupId = mCursor.getLong(GroupListLoader.GROUP_ID);
String title = mCursor.getString(GroupListLoader.TITLE);
int memberCount = mCursor.getInt(GroupListLoader.MEMBER_COUNT);
- int groupCountForThisAccount = mCursor.getInt(GroupListLoader.GROUP_COUNT_PER_ACCOUNT);
// Figure out if this is the first group for this account name / account type pair by
// checking the previous entry. This is to determine whether or not we need to display an
@@ -273,7 +272,7 @@
}
return new GroupListItem(accountName, accountType, dataSet, groupId, title,
- isFirstGroupInAccount, memberCount, groupCountForThisAccount);
+ isFirstGroupInAccount, memberCount);
}
@Override
@@ -349,10 +348,6 @@
entry.getAccountType(), entry.getDataSet());
viewCache.accountType.setText(accountType.getDisplayLabel(mContext).toString());
viewCache.accountName.setText(entry.getAccountName());
-
- int count = entry.getGroupCountForThisAccount();
- viewCache.groupCountForAccount.setText(mContext.getResources().getQuantityString(
- R.plurals.num_groups_in_account, count, count));
}
private static Uri getGroupUriFromId(long groupId) {
@@ -379,7 +374,6 @@
public static class GroupListItemViewCache {
public final TextView accountType;
public final TextView accountName;
- public final TextView groupCountForAccount;
public final TextView groupTitle;
public final TextView groupMemberCount;
public final View accountHeader;
@@ -389,7 +383,6 @@
public GroupListItemViewCache(View view) {
accountType = (TextView) view.findViewById(R.id.account_type);
accountName = (TextView) view.findViewById(R.id.account_name);
- groupCountForAccount = (TextView) view.findViewById(R.id.group_count);
groupTitle = (TextView) view.findViewById(R.id.label);
groupMemberCount = (TextView) view.findViewById(R.id.count);
accountHeader = view.findViewById(R.id.group_list_header);
diff --git a/src/com/android/contacts/group/GroupBrowseListFragment.java b/src/com/android/contacts/group/GroupBrowseListFragment.java
index 835400f..aca638e 100644
--- a/src/com/android/contacts/group/GroupBrowseListFragment.java
+++ b/src/com/android/contacts/group/GroupBrowseListFragment.java
@@ -152,8 +152,6 @@
}
private void configureVerticalScrollbar() {
- mListView.setFastScrollEnabled(true);
- mListView.setFastScrollAlwaysVisible(true);
mListView.setVerticalScrollbarPosition(mVerticalScrollbarPosition);
mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
int leftPadding = 0;
@@ -259,7 +257,8 @@
protected void requestSelectionToScreen() {
int selectedPosition = mAdapter.getSelectedGroupPosition();
if (selectedPosition != -1) {
- mListView.requestPositionToScreen(selectedPosition, true /* smooth scroll requested */);
+ mListView.requestPositionToScreen(selectedPosition,
+ true /* smooth scroll requested */);
}
}
diff --git a/src/com/android/contacts/group/GroupListItem.java b/src/com/android/contacts/group/GroupListItem.java
index c707ea7..a06ec38 100644
--- a/src/com/android/contacts/group/GroupListItem.java
+++ b/src/com/android/contacts/group/GroupListItem.java
@@ -28,12 +28,8 @@
private final boolean mIsFirstGroupInAccount;
private final int mMemberCount;
- /** Number of groups in the account that this group belongs to */
- private final int mGroupCountForThisAccount;
-
public GroupListItem(String accountName, String accountType, String dataSet, long groupId,
- String title, boolean isFirstGroupInAccount, int memberCount,
- int groupCountForThisAccount) {
+ String title, boolean isFirstGroupInAccount, int memberCount) {
mAccountName = accountName;
mAccountType = accountType;
mDataSet = dataSet;
@@ -41,7 +37,6 @@
mTitle = title;
mIsFirstGroupInAccount = isFirstGroupInAccount;
mMemberCount = memberCount;
- mGroupCountForThisAccount = groupCountForThisAccount;
}
public String getAccountName() {
@@ -75,8 +70,4 @@
public boolean isFirstGroupInAccount() {
return mIsFirstGroupInAccount;
}
-
- public int getGroupCountForThisAccount() {
- return mGroupCountForThisAccount;
- }
}
\ No newline at end of file
diff --git a/src/com/android/contacts/list/ContactEntryListAdapter.java b/src/com/android/contacts/list/ContactEntryListAdapter.java
index 4ac54dc..e75be26 100644
--- a/src/com/android/contacts/list/ContactEntryListAdapter.java
+++ b/src/com/android/contacts/list/ContactEntryListAdapter.java
@@ -106,6 +106,7 @@
((ContactListPinnedHeaderView)pinnedHeaderView).setSectionHeader(title);
}
+ @Override
protected void setPinnedHeaderContactsCount(View header) {
// Update the header with the contacts count only if a profile header exists
// otherwise, the contacts count are shown in the empty profile header view
@@ -116,6 +117,7 @@
}
}
+ @Override
protected void clearPinnedHeaderContactsCount(View header) {
((ContactListPinnedHeaderView)header).setCountView(null);
}
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 7ddece6..4c4b780 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -32,7 +32,6 @@
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
-import android.provider.ContactsContract.Contacts;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
@@ -89,7 +88,6 @@
private final int mCountViewTextSize;
private final int mContactsCountTextColor;
private final int mTextIndent;
-
private Drawable mActivatedBackgroundDrawable;
// Horizontal divider between contact views.
@@ -230,7 +228,7 @@
R.styleable.ContactListItemView_list_item_header_text_indent, 0);
mHeaderTextColor = a.getColor(
R.styleable.ContactListItemView_list_item_header_text_color, Color.BLACK);
- mHeaderTextSize = (int)a.getDimensionPixelSize(
+ mHeaderTextSize = a.getDimensionPixelSize(
R.styleable.ContactListItemView_list_item_header_text_size, 12);
mHeaderBackgroundHeight = a.getDimensionPixelSize(
R.styleable.ContactListItemView_list_item_header_height, 30);
@@ -240,7 +238,7 @@
R.styleable.ContactListItemView_list_item_header_underline_color, 0);
mTextIndent = a.getDimensionPixelOffset(
R.styleable.ContactListItemView_list_item_text_indent, 0);
- mCountViewTextSize = (int)a.getDimensionPixelSize(
+ mCountViewTextSize = a.getDimensionPixelSize(
R.styleable.ContactListItemView_list_item_contacts_count_text_size, 12);
mContactsCountTextColor = a.getColor(
R.styleable.ContactListItemView_list_item_contacts_count_text_color, Color.BLACK);
diff --git a/src/com/android/contacts/list/ContactListPinnedHeaderView.java b/src/com/android/contacts/list/ContactListPinnedHeaderView.java
index 5983007..5e95e4d 100644
--- a/src/com/android/contacts/list/ContactListPinnedHeaderView.java
+++ b/src/com/android/contacts/list/ContactListPinnedHeaderView.java
@@ -20,10 +20,8 @@
import android.content.Context;
import android.content.res.TypedArray;
-import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Typeface;
-import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
@@ -124,7 +122,7 @@
if (isViewMeasurable(mCountTextView)) {
mCountTextView.layout(width - mPaddingRight - mCountTextView.getMeasuredWidth(),
0,
- width,
+ width - mPaddingRight,
mHeaderBackgroundHeight);
}
diff --git a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
index 4db2270..5134a1a 100644
--- a/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
+++ b/src/com/android/contacts/list/DefaultContactBrowseListFragment.java
@@ -41,11 +41,14 @@
private View mSearchHeaderView;
private TextView mAccountFilterHeaderView;
private View mAccountFilterHeaderContainer;
+ private FrameLayout mProfileHeaderContainer;
private View mProfileHeader;
private Button mProfileMessage;
private FrameLayout mMessageContainer;
private View mProfileTitle;
+ private View mPaddingView;
+
public DefaultContactBrowseListFragment() {
setPhotoLoaderEnabled(true);
setSectionHeaderDisplayEnabled(true);
@@ -209,11 +212,14 @@
// Changing visibility of just the mProfileHeader doesn't do anything unless
// you change visibility of its children, hence the call to mCounterHeaderView
// and mProfileTitle
+ mProfileHeaderContainer.setVisibility(show ? View.VISIBLE : View.GONE);
mProfileHeader.setVisibility(show ? View.VISIBLE : View.GONE);
mCounterHeaderView.setVisibility(show ? View.VISIBLE : View.GONE);
mProfileTitle.setVisibility(show ? View.VISIBLE : View.GONE);
mMessageContainer.setVisibility(show ? View.VISIBLE : View.GONE);
mProfileMessage.setVisibility(show ? View.VISIBLE : View.GONE);
+
+ mPaddingView.setVisibility(show ? View.GONE : View.VISIBLE);
}
/**
@@ -226,14 +232,16 @@
ListView list = getListView();
// Put a header with the "ME" name and a view for the number of contacts
+ // The view is embedded in a frame view since you cannot change the visibility of a
+ // view in a ListView without having a parent view.
+ mProfileHeaderContainer = new FrameLayout(inflater.getContext());
mProfileHeader = inflater.inflate(R.layout.user_profile_header, null, false);
mCounterHeaderView = (TextView) mProfileHeader.findViewById(R.id.contacts_count);
mProfileTitle = mProfileHeader.findViewById(R.id.profile_title);
- list.addHeaderView(mProfileHeader, null, false);
+ mProfileHeaderContainer.addView(mProfileHeader);
+ list.addHeaderView(mProfileHeaderContainer, null, false);
// Add a selectable view with a message inviting the user to create a local profile
- // The view is embedded in a frame view since you cannot change the visibility of a
- // view in a ListView without having a parent view.
mMessageContainer = new FrameLayout(inflater.getContext());
mProfileMessage = (Button)inflater.inflate(R.layout.user_profile_button, null, false);
mMessageContainer.addView(mProfileMessage);
@@ -246,5 +254,11 @@
startActivity(intent);
}
});
+
+ View paddingViewContainer =
+ inflater.inflate(R.layout.contact_detail_list_padding, null, false);
+ mPaddingView = paddingViewContainer.findViewById(R.id.contact_detail_list_padding);
+ mPaddingView.setVisibility(View.GONE);
+ getListView().addHeaderView(paddingViewContainer);
}
}
diff --git a/src/com/android/contacts/list/PhoneNumberPickerFragment.java b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
index 306efbd..5986b9c 100644
--- a/src/com/android/contacts/list/PhoneNumberPickerFragment.java
+++ b/src/com/android/contacts/list/PhoneNumberPickerFragment.java
@@ -48,6 +48,11 @@
private TextView mAccountFilterHeaderView;
private View mAccountFilterHeaderContainer;
+ /**
+ * Lives as ListView's header and is shown when {@link #mAccountFilterHeaderContainer} is set
+ * to View.GONE.
+ */
+ private View mPaddingView;
private static final String KEY_FILTER = "filter";
@@ -80,6 +85,10 @@
protected void onCreateView(LayoutInflater inflater, ViewGroup container) {
super.onCreateView(inflater, container);
+ View paddingView = inflater.inflate(R.layout.contact_detail_list_padding, null, false);
+ mPaddingView = paddingView.findViewById(R.id.contact_detail_list_padding);
+ getListView().addHeaderView(paddingView);
+
mAccountFilterHeaderView = (TextView) getView().findViewById(R.id.account_filter_header);
mAccountFilterHeaderContainer =
getView().findViewById(R.id.account_filter_header_container);
@@ -101,8 +110,10 @@
mAccountFilterHeaderContainer.setVisibility(View.VISIBLE);
mAccountFilterHeaderView.setText(getContext().getString(
R.string.listAllContactsInAccount, filter.accountName));
+ mPaddingView.setVisibility(View.GONE);
} else {
mAccountFilterHeaderContainer.setVisibility(View.GONE);
+ mPaddingView.setVisibility(View.VISIBLE);
}
}
}