Merge "Show type OTHER again"
diff --git a/res/layout-sw580dp-w1000dp/contact_detail_fragment.xml b/res/layout-sw580dp-w1000dp/contact_detail_fragment.xml
new file mode 100644
index 0000000..9dd3690
--- /dev/null
+++ b/res/layout-sw580dp-w1000dp/contact_detail_fragment.xml
@@ -0,0 +1,65 @@
+<?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.
+-->
+
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ android:id="@+id/contact_detail"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/panel_content">
+
+ <!-- Placeholder for empty list -->
+ <include
+ android:id="@android:id/empty"
+ layout="@layout/contact_detail_empty"
+ android:visibility="gone" />
+
+ <!-- Real list -->
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView android:id="@+id/photo"
+ android:scaleType="centerCrop"
+ android:layout_width="@dimen/detail_contact_photo_size"
+ android:layout_height="@dimen/detail_contact_photo_size"
+ android:layout_marginLeft="@dimen/detail_contact_photo_margin"
+ android:layout_marginRight="@dimen/detail_contact_photo_margin"
+ android:layout_marginTop="@dimen/detail_contact_photo_margin"
+ android:layout_marginBottom="@dimen/detail_contact_photo_margin"/>
+
+ <ListView android:id="@android:id/list"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:divider="@null"/>
+
+ </LinearLayout>
+
+ <!-- "QuickFix"- button (Copy to local contact, add to group) -->
+ <Button
+ android:id="@+id/contact_quick_fix"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:visibility="gone"
+ android:layout_gravity="right"
+ android:layout_marginRight="40dip"
+ android:layout_marginTop="10dip"
+ android:layout_marginBottom="10dip" />
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml b/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
deleted file mode 100644
index 82432a0..0000000
--- a/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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:id="@+id/banner"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingBottom="28dip">
-
- <TextView
- android:id="@+id/attribution"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_header_attribution_height"
- android:paddingRight="16dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorTertiary"
- android:gravity="right|center_vertical"
- android:singleLine="true" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/photo"
- android:layout_marginLeft="-1dip"
- android:layout_width="96dip"
- android:layout_height="96dip" />
-
- <LinearLayout
- android:layout_width="0px"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:layout_gravity="top"
- android:orientation="vertical">
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="@color/contact_detail_header_divider_color" />
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingTop="16dip"
- android:layout_marginLeft="@dimen/detail_header_view_margin">
-
- <!-- Star -->
- <CheckBox
- android:id="@+id/star"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="4dip"
- android:layout_gravity="top"
- android:contentDescription="@string/description_star"
- android:visibility="invisible"
- style="?android:attr/starStyle" />
-
- <!-- Name, PhoneticName, Directory -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/detail_header_view_margin"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/name"
- style="@style/ContactDetailHeaderTextView"
- android:textSize="@dimen/contact_name_text_size" />
-
- <TextView
- android:id="@+id/phonetic_name"
- style="@style/ContactDetailHeaderTextView"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:layout_marginTop="-2dip"
- android:visibility="gone" />
-
- <TextView
- android:id="@+id/organization"
- style="@style/ContactDetailHeaderTextView"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorTertiary" />
- </LinearLayout>
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <!-- Status info -->
- <LinearLayout
- android:id="@+id/status_container"
- android:layout_width="0px"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:background="@drawable/statusbox_landscape_holo_light"
- android:layout_marginLeft="10dip"
- android:layout_marginTop="30dip"
- android:paddingLeft="52dip"
- android:paddingTop="12dip"
- android:paddingRight="16dip"
- android:paddingBottom="12dip"
- android:visibility="gone">
-
- <TextView
- android:id="@+id/status"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="3"
- android:ellipsize="end"
- android:visibility="gone" />
-
- <TextView
- android:id="@+id/status_date"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:gravity="right"
- android:visibility="gone" />
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
-</LinearLayout>
diff --git a/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml
new file mode 100644
index 0000000..1a1a3bb
--- /dev/null
+++ b/res/layout-sw580dp-w1000dp/detail_header_contact_with_updates.xml
@@ -0,0 +1,68 @@
+<?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.
+-->
+
+<!--
+ This is a header entry in the contact details list for when the contact has social updates. The
+ entry shows the contact's basic info and maintains vertical padding to ensure that the first
+ contact detail is visible (and below the tab carousel). The photo is not displayed here
+ because it will be shown in the tab carousel.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="20dip">
+
+ <ImageView
+ android:id="@+id/photo"
+ android:scaleType="centerCrop"
+ android:layout_width="@dimen/detail_contact_photo_size"
+ android:layout_height="@dimen/detail_contact_photo_size" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip">
+
+ <TextView
+ android:id="@+id/name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textSize="@dimen/detail_header_name_text_size" />
+
+ <TextView
+ android:id="@+id/company"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <CheckBox
+ android:id="@+id/star"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:contentDescription="@string/description_star"
+ style="?android:attr/starStyle" />
+
+ </LinearLayout>
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml b/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml
new file mode 100644
index 0000000..415bbbf
--- /dev/null
+++ b/res/layout-sw580dp-w1000dp/detail_header_contact_without_updates.xml
@@ -0,0 +1,50 @@
+<?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.
+-->
+
+<!--
+ This is a header entry in the contact details list for when the contact does not have social
+ updates, which means that the contact's basic info will scroll with the list of details. The
+ photo is not included because it will be displayed in a static place elsewhere.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingTop="20dip">
+
+ <TextView
+ android:id="@+id/name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textSize="@dimen/detail_header_name_text_size" />
+
+ <TextView
+ android:id="@+id/company"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <CheckBox
+ android:id="@+id/star"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:contentDescription="@string/description_star"
+ style="?android:attr/starStyle" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw580dp/contact_detail_header_view.xml b/res/layout-sw580dp/contact_detail_header_view.xml
deleted file mode 100644
index 95a5617..0000000
--- a/res/layout-sw580dp/contact_detail_header_view.xml
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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:id="@+id/banner"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingBottom="28dip">
-
- <TextView
- android:id="@+id/attribution"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_header_attribution_height"
- android:paddingRight="24dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorTertiary"
- android:gravity="right|center_vertical"
- android:singleLine="true" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
-
- <ImageView
- android:id="@+id/photo"
- android:layout_marginLeft="@dimen/detail_header_view_margin"
- android:layout_width="96dip"
- android:layout_height="96dip" />
-
- <LinearLayout
- android:layout_width="0px"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:orientation="vertical"
- android:layout_gravity="top">
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="@color/contact_detail_header_divider_color" />
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingTop="16dip"
- android:layout_marginLeft="@dimen/detail_header_view_margin">>
-
- <!-- Star -->
- <CheckBox
- android:id="@+id/star"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="4dip"
- android:layout_gravity="top"
- android:contentDescription="@string/description_star"
- android:visibility="invisible"
- style="?android:attr/starStyle" />
-
- <!-- Name, PhoneticName, Directory -->
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/detail_header_view_margin"
- android:orientation="vertical">
-
- <TextView
- android:id="@+id/name"
- style="@style/ContactDetailHeaderTextView"
- android:textSize="@dimen/contact_name_text_size" />
-
- <TextView
- android:id="@+id/phonetic_name"
- style="@style/ContactDetailHeaderTextView"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:layout_marginTop="-2dip"
- android:visibility="gone" />
-
- <TextView
- android:id="@+id/organization"
- style="@style/ContactDetailHeaderTextView"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorTertiary" />
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
- </LinearLayout>
-
- <!-- Status info -->
- <LinearLayout
- android:id="@+id/status_container"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:background="@drawable/statusbox_portrait_holo_light"
- android:layout_marginLeft="16dip"
- android:layout_marginRight="24dip"
- android:layout_marginTop="10dip"
- android:paddingLeft="12dip"
- android:paddingTop="36dip"
- android:paddingRight="16dip"
- android:paddingBottom="12dip"
- android:visibility="gone">
-
- <TextView
- android:id="@+id/status"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="3"
- android:ellipsize="end"
- android:visibility="gone" />
-
- <TextView
- android:id="@+id/status_date"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorTertiary"
- android:gravity="right"
- android:visibility="gone" />
- </LinearLayout>
-</LinearLayout>
diff --git a/res/layout-sw580dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp/detail_header_contact_with_updates.xml
new file mode 100644
index 0000000..e909434
--- /dev/null
+++ b/res/layout-sw580dp/detail_header_contact_with_updates.xml
@@ -0,0 +1,52 @@
+<?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.
+-->
+
+<!--
+ This is a header entry in the contact details list for when the contact has social updates. The
+ entry shows the contact's basic info and maintains vertical padding to ensure that the first
+ contact detail is visible (and below the tab carousel). The photo is not displayed here
+ because it will be shown in the tab carousel.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingTop="@dimen/detail_tab_carousel_height"
+ android:layout_marginTop="20dip">
+
+ <TextView
+ android:id="@+id/name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textSize="@dimen/detail_header_name_text_size" />
+
+ <TextView
+ android:id="@+id/company"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <CheckBox
+ android:id="@+id/star"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:contentDescription="@string/description_star"
+ style="?android:attr/starStyle" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout-sw580dp/detail_header_contact_without_updates.xml b/res/layout-sw580dp/detail_header_contact_without_updates.xml
new file mode 100644
index 0000000..4ae31c8
--- /dev/null
+++ b/res/layout-sw580dp/detail_header_contact_without_updates.xml
@@ -0,0 +1,55 @@
+<?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.
+-->
+
+<!--
+ This is a header entry in the contact details list for when the contact does not have social
+ updates, which means that the contact's photo and basic info will scroll with the list of details.
+-->
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:paddingTop="20dip">
+
+ <ImageView
+ android:id="@+id/photo"
+ android:scaleType="centerCrop"
+ android:layout_width="@dimen/detail_contact_photo_size"
+ android:layout_height="@dimen/detail_contact_photo_size" />
+
+ <TextView
+ android:id="@+id/name"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textSize="@dimen/detail_header_name_text_size" />
+
+ <TextView
+ android:id="@+id/company"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium" />
+
+ <CheckBox
+ android:id="@+id/star"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:contentDescription="@string/description_star"
+ style="?android:attr/starStyle" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/simple_contact_detail_header_view_list_item.xml b/res/layout-w470dp/detail_header_contact_with_updates.xml
similarity index 74%
copy from res/layout/simple_contact_detail_header_view_list_item.xml
copy to res/layout-w470dp/detail_header_contact_with_updates.xml
index eea4ac4..588957e 100644
--- a/res/layout/simple_contact_detail_header_view_list_item.xml
+++ b/res/layout-w470dp/detail_header_contact_with_updates.xml
@@ -14,15 +14,11 @@
limitations under the License.
-->
+<!--
+ This is a header entry in the contact details list for when the contact has social updates.
+ This is empty because all the information will be displayed elsewhere.
+-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/photo"
- android:scaleType="centerCrop"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height" />
-
-</FrameLayout>
\ No newline at end of file
+ android:layout_height="0dip"/>
\ No newline at end of file
diff --git a/res/layout/simple_contact_detail_header_view_list_item.xml b/res/layout-w470dp/detail_header_contact_without_updates.xml
similarity index 74%
copy from res/layout/simple_contact_detail_header_view_list_item.xml
copy to res/layout-w470dp/detail_header_contact_without_updates.xml
index eea4ac4..44ea04c 100644
--- a/res/layout/simple_contact_detail_header_view_list_item.xml
+++ b/res/layout-w470dp/detail_header_contact_without_updates.xml
@@ -14,15 +14,11 @@
limitations under the License.
-->
+<!--
+ This is a header entry in the contact details list for when the contact does not have social
+ updates. This is empty because all the information will be displayed elsewhere.
+-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/photo"
- android:scaleType="centerCrop"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height" />
-
-</FrameLayout>
\ No newline at end of file
+ android:layout_height="0dip"/>
\ No newline at end of file
diff --git a/res/layout/contact_detail_header_view.xml b/res/layout/contact_detail_header_view.xml
deleted file mode 100644
index 328a5ff..0000000
--- a/res/layout/contact_detail_header_view.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2009 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.
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/banner"
- android:layout_width="match_parent"
- android:layout_height="150dip">
-
- <ImageView android:id="@+id/photo"
- android:scaleType="centerCrop"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- />
-
- <!-- Transparent view to overlay on the contact's photo
- (to allow white text to appear over a white photo). -->
- <View
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:background="#000000"
- android:alpha=".25"
- />
-
- <LinearLayout
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_marginLeft="10dip"
- android:orientation="vertical" >
-
- <TextView android:id="@+id/name"
- android:layout_width="wrap_content"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:singleLine="true"
- android:ellipsize="end"
- android:gravity="bottom"
- android:textSize="@dimen/detail_header_name_text_size"
- android:textColor="@color/detail_header_view_text_color"
- />
-
- <TextView android:id="@+id/phonetic_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/detail_header_view_text_color"
- android:singleLine="true"
- android:ellipsize="end"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- />
-
- <TextView android:id="@+id/organization"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/detail_header_view_text_color"
- android:singleLine="true"
- android:ellipsize="end"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- />
-
- <TextView android:id="@+id/attribution"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:singleLine="true"
- android:ellipsize="end"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- />
-
- <TextView android:id="@+id/status"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="@color/detail_header_view_text_color"
- android:singleLine="true"
- android:ellipsize="end"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- />
-
- <TextView android:id="@+id/status_date"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textSize="12sp"
- android:layout_marginTop="-2dip"
- android:visibility="gone"
- />
- </LinearLayout>
-
- <CheckBox
- android:id="@+id/star"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="10dip"
- android:layout_marginRight="10dip"
- android:layout_alignParentTop="true"
- android:layout_alignParentRight="true"
- android:layout_gravity="center_vertical"
- android:contentDescription="@string/description_star"
- android:visibility="invisible"
- style="?android:attr/starStyle"
- />
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout/simple_contact_detail_header_view_list_item.xml b/res/layout/detail_header_contact_with_updates.xml
similarity index 69%
copy from res/layout/simple_contact_detail_header_view_list_item.xml
copy to res/layout/detail_header_contact_with_updates.xml
index eea4ac4..00d1b76 100644
--- a/res/layout/simple_contact_detail_header_view_list_item.xml
+++ b/res/layout/detail_header_contact_with_updates.xml
@@ -14,15 +14,12 @@
limitations under the License.
-->
+<!--
+ This is a header entry in the contact details list for when the contact has social updates. The
+ entry maintains vertical padding to ensure that the first contact detail is visible (and below
+ the tab carousel). No information has to be displayed in this header.
+-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:id="@+id/photo"
- android:scaleType="centerCrop"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_height" />
-
-</FrameLayout>
\ No newline at end of file
+ android:layout_height="@dimen/detail_tab_carousel_height"/>
\ No newline at end of file
diff --git a/res/layout/simple_contact_detail_header_view_list_item.xml b/res/layout/detail_header_contact_without_updates.xml
similarity index 84%
rename from res/layout/simple_contact_detail_header_view_list_item.xml
rename to res/layout/detail_header_contact_without_updates.xml
index eea4ac4..a5d4687 100644
--- a/res/layout/simple_contact_detail_header_view_list_item.xml
+++ b/res/layout/detail_header_contact_without_updates.xml
@@ -14,6 +14,10 @@
limitations under the License.
-->
+<!--
+ This is a header entry in the contact details list for when the contact does not have social
+ updates, which means that the contact's photo will scroll with the list of details.
+-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
diff --git a/res/layout/external_raw_contact_editor_view.xml b/res/layout/external_raw_contact_editor_view.xml
index be0c8ba..eb36cb2 100644
--- a/res/layout/external_raw_contact_editor_view.xml
+++ b/res/layout/external_raw_contact_editor_view.xml
@@ -20,121 +20,116 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
->
+ android:paddingBottom="10dip">
<!-- Left side color bar -->
<ImageView
android:id="@+id/color_bar"
android:layout_width="4dip"
android:layout_height="match_parent"
- android:visibility="gone"
- />
+ android:visibility="gone"/>
<!-- The content -->
<LinearLayout
android:layout_width="0dip"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:orientation="vertical"
- >
+ android:orientation="vertical">
<!-- Account info header -->
- <RelativeLayout android:id="@+id/header"
- android:layout_height="64dip"
+ <ImageView android:id="@+id/header_color_bar"
android:layout_width="match_parent"
- >
-
- <ImageView android:id="@+id/header_color_bar"
- android:layout_width="match_parent"
- android:layout_height="4dip"
- android:layout_marginBottom="5dip"
- android:background="@color/edit_divider"
- />
-
- <ImageView android:id="@+id/account_icon"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="7dip"
- android:layout_marginRight="7dip"
- android:layout_centerVertical="true"
- android:layout_below="@id/header_color_bar"
- />
-
- <TextView android:id="@+id/account_type"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/account_icon"
- android:layout_alignTop="@id/account_icon"
- android:layout_marginTop="-4dip"
-
- android:textSize="24sp"
- android:textColor="?android:attr/textColorPrimary"
- android:singleLine="true"
- />
-
- <TextView android:id="@+id/account_name"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_toRightOf="@+id/account_icon"
- android:layout_alignBottom="@+id/account_icon"
- android:layout_marginBottom="2dip"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorPrimary"
- android:singleLine="true"
- />
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:layout_alignParentBottom="true"
-
- android:background="?android:attr/listDivider"
- />
-
- </RelativeLayout>
-
- <FrameLayout
- android:id="@+id/stub_photo"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="12dip"
- android:paddingTop="10dip">
-
- <include
- android:id="@+id/edit_photo"
- layout="@layout/item_photo_editor" />
-
- </FrameLayout>
-
- <TextView android:id="@+id/read_only_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="6dip"
- android:layout_marginBottom="6dip"
- android:layout_marginLeft="10dip"
-
- android:textAppearance="?android:attr/textAppearanceLarge"
- />
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="?android:attr/listDivider"
- />
+ android:layout_height="4dip"
+ android:layout_marginBottom="5dip"
+ android:background="@color/edit_divider"/>
<TextView
android:id="@+id/read_only_warning"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="13dip"
- android:layout_marginBottom="13dip"
- android:layout_marginLeft="13dip"
-
+ android:paddingTop="10dip"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorPrimary"
- android:drawableLeft="?android:attr/alertDialogIcon"
- android:drawablePadding="10dip"
- />
+ android:textColor="?android:attr/textColorTertiary"/>
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip">
+
+ <LinearLayout
+ android:id="@+id/account"
+ android:layout_height="wrap_content"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:background="?android:attr/selectableItemBackground">
+
+ <TextView
+ android:id="@+id/account_type"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:singleLine="true" />
+
+ <TextView
+ android:id="@+id/account_name"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ android:textColor="?android:attr/textColorTertiary"
+ android:singleLine="true" />
+
+ </LinearLayout>
+
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:id="@+id/account_icon"
+ android:layout_width="45dip"
+ android:layout_height="45dip"
+ android:layout_gravity="center_vertical" />
+
+ </FrameLayout>
+
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_height="wrap_content"
+ android:layout_width="match_parent"
+ android:orientation="horizontal"
+ android:paddingTop="20dip"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip">
+
+ <TextView android:id="@+id/read_only_name"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:gravity="center_vertical"
+ android:singleLine="true"
+ android:ellipsize="end"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorTertiary"
+ android:textStyle="bold"/>
+
+ <FrameLayout
+ android:id="@+id/stub_photo"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+
+ <include
+ android:id="@+id/edit_photo"
+ layout="@layout/item_photo_editor" />
+
+ </FrameLayout>
+
+ </LinearLayout>
<Button
android:id="@+id/button_edit_externally"
@@ -143,20 +138,13 @@
android:layout_height="wrap_content"
android:layout_marginTop="13dip"
android:layout_marginBottom="13dip"
- android:layout_marginLeft="13dip"
- />
-
- <View
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="?android:attr/listDivider"
- />
+ android:layout_marginLeft="13dip"/>
<LinearLayout android:id="@+id/sect_general"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical"
- />
+ android:orientation="vertical"/>
+
</LinearLayout>
</com.android.contacts.editor.ExternalRawContactEditorView>
diff --git a/res/layout/group_list_header_item.xml b/res/layout/group_browse_list_account_header.xml
similarity index 98%
rename from res/layout/group_list_header_item.xml
rename to res/layout/group_browse_list_account_header.xml
index b38920f..73684c1 100644
--- a/res/layout/group_list_header_item.xml
+++ b/res/layout/group_browse_list_account_header.xml
@@ -33,6 +33,7 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/people_app_theme_color"
android:textStyle="bold"
+ android:textAllCaps="true"
android:singleLine="true"/>
<TextView
diff --git a/res/layout/group_browse_list_item.xml b/res/layout/group_browse_list_item.xml
index b829704..ecdc132 100644
--- a/res/layout/group_browse_list_item.xml
+++ b/res/layout/group_browse_list_item.xml
@@ -14,21 +14,48 @@
limitations under the License.
-->
-<view
+<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.contacts.group.GroupBrowseListAdapter$GroupListItem"
- android:orientation="horizontal"
+ android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:paddingBottom="10dip"
style="@style/GroupBrowseListItem">
+ <ImageView
+ android:id="@+id/divider"
+ android:layout_width="match_parent"
+ android:layout_height="1dip"
+ android:layout_marginBottom="10dip"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
+ android:scaleType="fitXY"
+ android:src="@color/people_app_theme_color"/>
+
+ <include
+ android:id="@+id/group_list_header"
+ 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:padding="10dip"
- android:textAppearance="?android:attr/textAppearanceLarge"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
+ android:textAppearance="?android:attr/textAppearanceMedium"
android:ellipsize="end"
android:singleLine="true" />
-</view>
+ <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>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 2bba6ac..18b86be 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -144,7 +144,7 @@
<dimen name="detail_network_icon_size">32dip</dimen>
<!-- Font size for the display name in header of the contact detail page -->
- <dimen name="detail_header_name_text_size">30sp</dimen>
+ <dimen name="detail_header_name_text_size">36sp</dimen>
<!-- Padding to be used between a visible scrollbar and the contact list -->
<dimen name="list_visible_scrollbar_padding">40dip</dimen>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 7d11c54..5ff5662 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -1293,8 +1293,8 @@
<!-- Checkbox asking the user if they want to display a particular photo for a contact -->
<string name="use_photo_as_primary">Use this photo</string>
- <!-- Text used to explain that a contact cannot be edited since the data is read only -->
- <string name="contact_read_only"><xliff:g id="source" example="Gmail">%1$s</xliff:g> contact information is not editable on this device.</string>
+ <!-- Text used to explain that a contact cannot be edited since the data is read only [CHAR LIMIT=40] -->
+ <string name="contact_read_only">Not editable on this device</string>
<!-- Text describing that a contact has no information available other than name and photo -->
<string name="no_contact_details">No additional information for this contact</string>
@@ -1557,6 +1557,12 @@
<item quantity="other"><xliff:g id="count">%1$d</xliff:g> people from <xliff:g id="account_type">%2$s</xliff:g></item>
</plurals>
+ <!-- Subtitle of a group (in the group list) that describes how many people are in the current group [CHAR LIMIT=30] -->
+ <plurals name="group_list_num_contacts_in_group">
+ <item quantity="one"><xliff:g id="count">%1$d</xliff:g> person</item>
+ <item quantity="other"><xliff:g id="count">%1$d</xliff:g> people</item>
+ </plurals>
+
<!-- Toast displayed when the user creates a new contact and attempts to join it
with another before entering any data [CHAR LIMIT=256] -->
<string name="toast_join_with_empty_contact">Please enter contact name before joining
diff --git a/src/com/android/contacts/ContactOptionsActivity.java b/src/com/android/contacts/ContactOptionsActivity.java
index 9ae8fe9..dd7387f 100644
--- a/src/com/android/contacts/ContactOptionsActivity.java
+++ b/src/com/android/contacts/ContactOptionsActivity.java
@@ -16,6 +16,8 @@
package com.android.contacts;
+import com.android.contacts.activities.PeopleActivity;
+
import android.app.ActionBar;
import android.app.Activity;
import android.content.ContentValues;
@@ -221,6 +223,9 @@
switch (item.getItemId()) {
case android.R.id.home:
+ Intent intent = new Intent(this, PeopleActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(intent);
finish();
return true;
default:
diff --git a/src/com/android/contacts/GroupListLoader.java b/src/com/android/contacts/GroupListLoader.java
new file mode 100644
index 0000000..49aa602
--- /dev/null
+++ b/src/com/android/contacts/GroupListLoader.java
@@ -0,0 +1,52 @@
+/*
+ * 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
+ */
+package com.android.contacts;
+
+import android.content.Context;
+import android.content.CursorLoader;
+import android.provider.ContactsContract.Groups;
+
+/**
+ * Group loader for the group list that includes details such as the number of contacts per group.
+ * This group list excludes default, favorite, and deleted groups.
+ */
+public final class GroupListLoader extends CursorLoader {
+
+ private final static String[] COLUMNS = new String[] {
+ Groups.ACCOUNT_NAME,
+ Groups.ACCOUNT_TYPE,
+ Groups._ID,
+ Groups.TITLE,
+ Groups.ACTION,
+ Groups.ACTION_URI,
+ Groups.SUMMARY_COUNT,
+ };
+
+ public final static int ACCOUNT_NAME = 0;
+ public final static int ACCOUNT_TYPE = 1;
+ public final static int GROUP_ID = 2;
+ public final static int TITLE = 3;
+ public final static int ACTION = 4;
+ public final static int ACTION_URI = 5;
+ public final static int MEMBER_COUNT = 6;
+
+ public GroupListLoader(Context context) {
+ super(context, Groups.CONTENT_SUMMARY_URI, COLUMNS, Groups.ACCOUNT_TYPE + " NOT NULL AND "
+ + Groups.ACCOUNT_NAME + " NOT NULL AND " + Groups.AUTO_ADD + "=0 AND " +
+ Groups.FAVORITES + "=0 AND " + Groups.DELETED + "=0", null,
+ Groups.ACCOUNT_NAME + " ASC");
+ }
+}
diff --git a/src/com/android/contacts/activities/ContactDetailActivity.java b/src/com/android/contacts/activities/ContactDetailActivity.java
index 4d04ac2..a31694f 100644
--- a/src/com/android/contacts/activities/ContactDetailActivity.java
+++ b/src/com/android/contacts/activities/ContactDetailActivity.java
@@ -161,11 +161,6 @@
mDetailFragment.setListener(mFragmentListener);
mDetailFragment.setVerticalScrollListener(mVerticalScrollListener);
mDetailFragment.setData(mLookupUri, mContactData);
- // If the contact has social updates, then the photo should be shown in the tab
- // carousel, so don't show the photo again in the scrolling list of contact details.
- // We also don't want to show the photo if there is a fragment carousel because then
- // the picture will already be on the left of the list of contact details.
- mDetailFragment.setShowPhotoInHeader(!mContactHasUpdates && mFragmentCarousel == null);
} else if (fragment instanceof ContactDetailUpdatesFragment) {
mUpdatesFragment = (ContactDetailUpdatesFragment) fragment;
mUpdatesFragment.setData(mLookupUri, mContactData);
@@ -531,6 +526,9 @@
switch (item.getItemId()) {
case android.R.id.home:
+ Intent intent = new Intent(this, PeopleActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(intent);
finish();
return true;
default:
diff --git a/src/com/android/contacts/activities/GroupDetailActivity.java b/src/com/android/contacts/activities/GroupDetailActivity.java
index 9f6aa90..c7cf47c 100644
--- a/src/com/android/contacts/activities/GroupDetailActivity.java
+++ b/src/com/android/contacts/activities/GroupDetailActivity.java
@@ -146,6 +146,9 @@
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
+ Intent intent = new Intent(this, PeopleActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(intent);
finish();
return true;
default:
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 57a5583..17df4b4 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -129,7 +129,7 @@
private ContactLoader.Result mContactData;
private ViewGroup mHeaderView;
- private ImageView mPhotoView;
+ private ImageView mStaticPhotoView;
private ListView mListView;
private ViewAdapter mAdapter;
private Uri mPrimaryPhoneUri = null;
@@ -140,8 +140,8 @@
private final ArrayList<Long> mWritableRawContactIds = new ArrayList<Long>();
private int mNumPhoneNumbers = 0;
private String mDefaultCountryIso;
- private boolean mContactDataDisplayed;
- private boolean mContactPhotoDisplayedInHeader = true;
+ private boolean mContactHasSocialUpdates;
+ private boolean mShowStaticPhoto = true;
private final QuickFix[] mPotentialQuickFixes = new QuickFix[] {
new MakeLocalCopyQuickFix(),
@@ -248,7 +248,7 @@
mInflater = inflater;
- mPhotoView = (ImageView) mView.findViewById(R.id.photo);
+ mStaticPhotoView = (ImageView) mView.findViewById(R.id.photo);
mListView = (ListView) mView.findViewById(android.R.id.list);
mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
@@ -336,11 +336,11 @@
}
/**
- * Sets whether or not the contact photo should be shown in the list of contact details in this
- * {@link Fragment}.
+ * Sets whether the static contact photo (that is not in a scrolling region), should be shown
+ * or not.
*/
- public void setShowPhotoInHeader(boolean showPhoto) {
- mContactPhotoDisplayedInHeader = showPhoto;
+ public void setShowStaticPhoto(boolean showPhoto) {
+ mShowStaticPhoto = showPhoto;
}
public void setData(Uri lookupUri, ContactLoader.Result result) {
@@ -371,9 +371,21 @@
// Clear old header
mHeaderView = null;
+ // Figure out if the contact has social updates or not
+ mContactHasSocialUpdates = !mContactData.getStreamItems().isEmpty();
+
// Setup the photo if applicable
- if (mPhotoView != null) {
- ContactDetailDisplayUtils.setPhoto(mContext, mContactData, mPhotoView);
+ if (mStaticPhotoView != null) {
+ // The presence of a static photo view is not sufficient to determine whether or not
+ // we should show the photo. Check the mShowStaticPhoto flag which can be set by an
+ // outside class depending on screen size, layout, and whether the contact has social
+ // updates or not.
+ if (mShowStaticPhoto) {
+ mStaticPhotoView.setVisibility(View.VISIBLE);
+ ContactDetailDisplayUtils.setPhoto(mContext, mContactData, mStaticPhotoView);
+ } else {
+ mStaticPhotoView.setVisibility(View.GONE);
+ }
}
// Build up the contact entries
@@ -1259,26 +1271,21 @@
return mHeaderView;
}
- mHeaderView = (ViewGroup) inflate(
- R.layout.simple_contact_detail_header_view_list_item, parent, false);
+ int resourceId = mContactHasSocialUpdates ?
+ R.layout.detail_header_contact_with_updates :
+ R.layout.detail_header_contact_without_updates;
+ mHeaderView = (ViewGroup) inflate(resourceId, parent, false);
TextView displayNameView = (TextView) mHeaderView.findViewById(R.id.name);
TextView companyView = (TextView) mHeaderView.findViewById(R.id.company);
- TextView phoneticNameView = (TextView) mHeaderView.findViewById(R.id.phonetic_name);
- TextView attributionView = (TextView) mHeaderView.findViewById(R.id.attribution);
ImageView photoView = (ImageView) mHeaderView.findViewById(R.id.photo);
ContactDetailDisplayUtils.setDisplayName(mContext, mContactData, displayNameView);
ContactDetailDisplayUtils.setCompanyName(mContext, mContactData, companyView);
- ContactDetailDisplayUtils.setPhoneticName(mContext, mContactData, phoneticNameView);
- ContactDetailDisplayUtils.setAttribution(mContext, mContactData, attributionView);
// Set the photo if it should be displayed
- if (mContactPhotoDisplayedInHeader) {
+ if (photoView != null) {
ContactDetailDisplayUtils.setPhoto(mContext, mContactData, photoView);
- } else {
- // Otherwise hide the view
- photoView.setVisibility(View.INVISIBLE);
}
// Set the starred state if it should be displayed
diff --git a/src/com/android/contacts/detail/ContactDetailLayoutController.java b/src/com/android/contacts/detail/ContactDetailLayoutController.java
index d93edea..d912670 100644
--- a/src/com/android/contacts/detail/ContactDetailLayoutController.java
+++ b/src/com/android/contacts/detail/ContactDetailLayoutController.java
@@ -137,7 +137,9 @@
switch (mLayoutMode) {
case TWO_COLUMN: {
- // Set the contact data
+ // Set the contact data (hide the static photo because the photo will already be in
+ // the header that scrolls with contact details).
+ mContactDetailFragment.setShowStaticPhoto(false);
mContactDetailFragment.setData(mContactData.getLookupUri(), mContactData);
mContactDetailUpdatesFragment.setData(mContactData.getLookupUri(), mContactData);
@@ -175,6 +177,7 @@
switch (mLayoutMode) {
case TWO_COLUMN:
+ mContactDetailFragment.setShowStaticPhoto(true);
mContactDetailFragment.setData(mContactData.getLookupUri(), mContactData);
ft.hide(mContactDetailUpdatesFragment);
break;
@@ -227,7 +230,6 @@
}
mPagerContactDetailFragment.setListener(mContactDetailFragmentListener);
mPagerContactDetailFragment.setVerticalScrollListener(mVerticalScrollListener);
- mPagerContactDetailFragment.setShowPhotoInHeader(false);
return mPagerContactDetailFragment;
case 1:
mPagerContactDetailUpdatesFragment = new ContactDetailUpdatesFragment();
diff --git a/src/com/android/contacts/editor/ExternalRawContactEditorView.java b/src/com/android/contacts/editor/ExternalRawContactEditorView.java
index 89cace0..e1a669b 100644
--- a/src/com/android/contacts/editor/ExternalRawContactEditorView.java
+++ b/src/com/android/contacts/editor/ExternalRawContactEditorView.java
@@ -164,7 +164,7 @@
mName.setText(primary.getAsString(StructuredName.DISPLAY_NAME));
if (type.readOnly) {
- mReadOnlyWarning.setText(mContext.getString(R.string.contact_read_only, accountType));
+ mReadOnlyWarning.setText(mContext.getString(R.string.contact_read_only));
mReadOnlyWarning.setVisibility(View.VISIBLE);
mEditExternallyButton.setVisibility(View.GONE);
} else {
diff --git a/src/com/android/contacts/group/GroupBrowseListAdapter.java b/src/com/android/contacts/group/GroupBrowseListAdapter.java
index 2dd194d..d44733b 100644
--- a/src/com/android/contacts/group/GroupBrowseListAdapter.java
+++ b/src/com/android/contacts/group/GroupBrowseListAdapter.java
@@ -16,28 +16,22 @@
package com.android.contacts.group;
-import com.android.contacts.GroupMetaData;
+import com.android.contacts.GroupListLoader;
import com.android.contacts.R;
import com.android.contacts.model.AccountType;
import com.android.contacts.model.AccountTypeManager;
-import android.accounts.Account;
import android.content.ContentUris;
import android.content.Context;
+import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract.Groups;
-import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
-import android.widget.LinearLayout;
import android.widget.TextView;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
/**
* Adapter to populate the list of groups.
*/
@@ -47,49 +41,36 @@
private final LayoutInflater mLayoutInflater;
private final AccountTypeManager mAccountTypeManager;
- private List<GroupListEntry> mGroupList = new ArrayList<GroupListEntry>();
+ private Cursor mCursor;
+
private boolean mSelectionVisible;
private Uri mSelectedGroupUri;
- enum ViewType {
- HEADER, ITEM;
- }
-
- private static final int VIEW_TYPE_COUNT = ViewType.values().length;
-
- public GroupBrowseListAdapter(Context context, Map<Account, List<GroupMetaData>> groupMap) {
+ public GroupBrowseListAdapter(Context context) {
mContext = context;
mLayoutInflater = LayoutInflater.from(context);
mAccountTypeManager = AccountTypeManager.getInstance(mContext);
+ }
- for (Account account : groupMap.keySet()) {
- List<GroupMetaData> groupsListForAccount = groupMap.get(account);
-
- // Add account name, type, and # of groups as header for section
- mGroupList.add(GroupListEntry.createEntryForHeader(account.name, account.type,
- groupsListForAccount.size()));
-
- // Add groups within that account as subsequent list items.
- for (GroupMetaData singleGroup : groupsListForAccount) {
- mGroupList.add(GroupListEntry.createEntryForGroup(singleGroup));
- }
- }
+ public void setCursor(Cursor cursor) {
+ mCursor = cursor;
+ notifyDataSetChanged();
}
public int getSelectedGroupPosition() {
- if (mSelectedGroupUri == null) {
+ if (mSelectedGroupUri == null || mCursor == null || mCursor.getCount() == 0) {
return -1;
}
- int size = mGroupList.size();
- for (int i = 0; i < size; i++) {
- GroupListEntry group = mGroupList.get(i);
- if (group.type == ViewType.ITEM) {
- Uri uri = getGroupUriFromId(group.groupData.getGroupId());
- if (mSelectedGroupUri.equals(uri)) {
- return i;
- }
+ int index = 0;
+ mCursor.moveToPosition(-1);
+ while (mCursor.moveToNext()) {
+ long groupId = mCursor.getLong(GroupListLoader.GROUP_ID);
+ Uri uri = getGroupUriFromId(groupId);
+ if (mSelectedGroupUri.equals(uri)) {
+ return index;
}
+ index++;
}
return -1;
}
@@ -108,163 +89,123 @@
@Override
public int getCount() {
- return mGroupList.size();
+ return mCursor == null ? 0 : mCursor.getCount();
}
@Override
public long getItemId(int position) {
- return mGroupList.get(position).id;
+ return position;
}
@Override
- public GroupListEntry getItem(int position) {
- return mGroupList.get(position);
- }
+ public GroupListItem getItem(int position) {
+ if (mCursor == null || mCursor.isClosed() || !mCursor.moveToPosition(position)) {
+ return null;
+ }
+ String accountName = mCursor.getString(GroupListLoader.ACCOUNT_NAME);
+ String accountType = mCursor.getString(GroupListLoader.ACCOUNT_TYPE);
+ long groupId = mCursor.getLong(GroupListLoader.GROUP_ID);
+ String title = mCursor.getString(GroupListLoader.TITLE);
+ int memberCount = mCursor.getInt(GroupListLoader.MEMBER_COUNT);
- @Override
- public int getItemViewType(int position) {
- return mGroupList.get(position).type.ordinal();
- }
+ // 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
+ // account header in this item.
+ int previousIndex = position - 1;
+ boolean isFirstGroupInAccount = true;
+ if (previousIndex >= 0 && mCursor.moveToPosition(previousIndex)) {
+ String previousGroupAccountName = mCursor.getString(GroupListLoader.ACCOUNT_NAME);
+ String previousGroupAccountType = mCursor.getString(GroupListLoader.ACCOUNT_TYPE);
+ if (accountName.equals(previousGroupAccountName) &&
+ accountType.equals(previousGroupAccountType)) {
+ isFirstGroupInAccount = false;
+ }
+ }
- @Override
- public int getViewTypeCount() {
- return VIEW_TYPE_COUNT;
- }
-
- @Override
- public boolean areAllItemsEnabled() {
- return false;
- }
-
- @Override
- public boolean isEnabled(int position) {
- return mGroupList.get(position).type == ViewType.ITEM;
+ return new GroupListItem(accountName, accountType, groupId, title, isFirstGroupInAccount,
+ memberCount);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
- GroupListEntry item = getItem(position);
- switch (item.type) {
- case HEADER:
- return getHeaderView(item, convertView, parent);
- case ITEM:
- return getGroupListItemView(item, convertView, parent);
- default:
- throw new IllegalStateException("Invalid GroupListEntry item type " + item.type);
+ GroupListItem entry = getItem(position);
+ View result;
+ GroupListItemViewCache viewCache;
+ if (convertView != null) {
+ result = convertView;
+ viewCache = (GroupListItemViewCache) result.getTag();
+ } else {
+ result = mLayoutInflater.inflate(R.layout.group_browse_list_item, parent, false);
+ viewCache = new GroupListItemViewCache(result);
+ result.setTag(viewCache);
}
- }
+ // Add a header if this is the first group in an account and hide the divider
+ if (entry.isFirstGroupInAccount()) {
+ bindHeaderView(entry, viewCache);
+ viewCache.accountHeader.setVisibility(View.VISIBLE);
+ viewCache.divider.setVisibility(View.GONE);
+ } else {
+ viewCache.accountHeader.setVisibility(View.GONE);
+ viewCache.divider.setVisibility(View.VISIBLE);
+ }
- private View getHeaderView(GroupListEntry entry, View convertView, ViewGroup parent) {
- View result = (convertView == null ?
- mLayoutInflater.inflate(R.layout.group_list_header_item, parent, false) :
- convertView);
+ // Bind the group data
+ Uri groupUri = getGroupUriFromId(entry.getGroupId());
+ String memberCountString = mContext.getResources().getQuantityString(
+ R.plurals.group_list_num_contacts_in_group, entry.getMemberCount(),
+ entry.getMemberCount());
+ viewCache.setUri(groupUri);
+ viewCache.groupTitle.setText(entry.getTitle());
+ viewCache.groupMemberCount.setText(memberCountString);
- TextView accountTypeTextView = (TextView) result.findViewById(R.id.account_type);
- AccountType accountType = mAccountTypeManager.getAccountType(entry.accountType);
- accountTypeTextView.setText(accountType.getDisplayLabel(mContext).toString().toUpperCase());
-
- TextView accountNameTextView = (TextView) result.findViewById(R.id.account_name);
- accountNameTextView.setText(entry.accountName);
-
- String groupCountString = mContext.getResources().getQuantityString(
- R.plurals.num_groups_in_account, entry.count, entry.count);
- TextView groupCountTextView = (TextView) result.findViewById(R.id.group_count);
- groupCountTextView.setText(groupCountString);
-
- return result;
- }
-
- private View getGroupListItemView(GroupListEntry entry, View convertView, ViewGroup parent) {
- GroupListItem result = (GroupListItem) (convertView == null ?
- mLayoutInflater.inflate(R.layout.group_browse_list_item, parent, false) :
- convertView);
- result.loadFromGroup(entry.groupData);
if (mSelectionVisible) {
- result.setActivated(isSelectedGroup(result.getUri()));
+ result.setActivated(isSelectedGroup(groupUri));
}
return result;
}
- /**
- * This is a data model object to represent one row in the list of groups were the entry
- * could be a header or group item.
- */
- public static class GroupListEntry {
- public final ViewType type;
- public final String accountType;
- public final String accountName;
- public final int count;
- public final GroupMetaData groupData;
- /**
- * The id is equal to the group ID (if groupData is available), otherwise it is -1 for
- * header entries.
- */
- public final long id;
+ private void bindHeaderView(GroupListItem entry, GroupListItemViewCache viewCache) {
+ AccountType accountType = mAccountTypeManager.getAccountType(entry.getAccountType());
+ viewCache.accountType.setText(accountType.getDisplayLabel(mContext).toString());
+ viewCache.accountName.setText(entry.getAccountName());
- private GroupListEntry(ViewType entryType, String groupAccountName, String groupAccountType,
- int headerGroupCount, GroupMetaData groupMetaData, long entryId) {
- type = entryType;
- accountName = groupAccountName;
- accountType = groupAccountType;
- count = headerGroupCount;
- groupData = groupMetaData;
- id = entryId;
- }
+ // TODO: Add in number of groups within this account name / type using this string:
+ // getQuantityString(R.plurals.num_groups_in_account, entry.count, entry.count);
+ }
- public static GroupListEntry createEntryForHeader(String groupAccountName,
- String groupAccountType, int groupCount) {
- return new GroupListEntry(ViewType.HEADER, groupAccountName, groupAccountType,
- groupCount, null, -1);
- }
-
- public static GroupListEntry createEntryForGroup(GroupMetaData groupMetaData) {
- if (groupMetaData == null) {
- throw new IllegalStateException("Cannot create list entry for a null group");
- }
- return new GroupListEntry(ViewType.ITEM, null, null, 0, groupMetaData,
- groupMetaData.getGroupId());
- }
+ private static Uri getGroupUriFromId(long groupId) {
+ return ContentUris.withAppendedId(Groups.CONTENT_URI, groupId);
}
/**
- * A row in a list of groups, where this row displays a single group's title
- * and associated account.
+ * Cache of the children views of a contact detail entry represented by a
+ * {@link GroupListItem}
*/
- public static class GroupListItem extends LinearLayout {
-
- private TextView mLabel;
+ public static class GroupListItemViewCache {
+ public final TextView accountType;
+ public final TextView accountName;
+ public final TextView groupTitle;
+ public final TextView groupMemberCount;
+ public final View accountHeader;
+ public final View divider;
private Uri mUri;
- public GroupListItem(Context context, AttributeSet attrs, int defStyle) {
- super(context, attrs, defStyle);
+ public GroupListItemViewCache(View view) {
+ accountType = (TextView) view.findViewById(R.id.account_type);
+ accountName = (TextView) view.findViewById(R.id.account_name);
+ groupTitle = (TextView) view.findViewById(R.id.label);
+ groupMemberCount = (TextView) view.findViewById(R.id.count);
+ accountHeader = view.findViewById(R.id.group_list_header);
+ divider = view.findViewById(R.id.divider);
}
- public GroupListItem(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- public GroupListItem(Context context) {
- super(context);
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mLabel = (TextView) findViewById(R.id.label);
- }
-
- public void loadFromGroup(GroupMetaData group) {
- mLabel.setText(group.getTitle());
- mUri = getGroupUriFromId(group.getGroupId());
+ public void setUri(Uri uri) {
+ mUri = uri;
}
public Uri getUri() {
return mUri;
}
}
-
- private static Uri getGroupUriFromId(long groupId) {
- return ContentUris.withAppendedId(Groups.CONTENT_URI, groupId);
- }
}
\ No newline at end of file
diff --git a/src/com/android/contacts/group/GroupBrowseListFragment.java b/src/com/android/contacts/group/GroupBrowseListFragment.java
index 4e6bdbc..d0d370e 100644
--- a/src/com/android/contacts/group/GroupBrowseListFragment.java
+++ b/src/com/android/contacts/group/GroupBrowseListFragment.java
@@ -16,13 +16,11 @@
package com.android.contacts.group;
-import com.android.contacts.GroupMetaData;
-import com.android.contacts.GroupMetaDataLoader;
+import com.android.contacts.GroupListLoader;
import com.android.contacts.R;
-import com.android.contacts.group.GroupBrowseListAdapter.GroupListItem;
+import com.android.contacts.group.GroupBrowseListAdapter.GroupListItemViewCache;
import com.android.contacts.widget.AutoScrollListView;
-import android.accounts.Account;
import android.app.Activity;
import android.app.Fragment;
import android.app.LoaderManager;
@@ -34,7 +32,6 @@
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcelable;
-import android.provider.ContactsContract.Groups;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -47,11 +44,6 @@
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
/**
* Fragment to display the list of groups.
*/
@@ -82,13 +74,6 @@
private static final String EXTRA_KEY_GROUP_URI = "groups.groupUri";
- /**
- * Map of {@link Account} to a list of {@link GroupMetaData} objects
- * representing groups within that account.
- */
- private final Map<Account, List<GroupMetaData>> mGroupMap =
- new HashMap<Account, List<GroupMetaData>>();
-
private View mRootView;
private AutoScrollListView mListView;
private View mEmptyView;
@@ -108,10 +93,25 @@
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mRootView = inflater.inflate(R.layout.group_browse_list_fragment, null);
+ mEmptyView = mRootView.findViewById(R.id.empty);
+
+ mAdapter = new GroupBrowseListAdapter(mContext);
+ mAdapter.setSelectionVisible(mSelectionVisible);
+ mAdapter.setSelectedGroup(mSelectedGroupUri);
+
mListView = (AutoScrollListView) mRootView.findViewById(R.id.list);
mListView.setOnFocusChangeListener(this);
mListView.setOnTouchListener(this);
- mEmptyView = mRootView.findViewById(R.id.empty);
+ mListView.setAdapter(mAdapter);
+ mListView.setOnItemClickListener(new OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ GroupListItemViewCache groupListItem = (GroupListItemViewCache) view.getTag();
+ if (groupListItem != null) {
+ viewGroup(groupListItem.getUri());
+ }
+ }
+ });
if (savedInstanceState != null) {
String groupUriString = savedInstanceState.getString(EXTRA_KEY_GROUP_URI);
@@ -173,7 +173,7 @@
@Override
public CursorLoader onCreateLoader(int id, Bundle args) {
- return new GroupMetaDataLoader(mContext, Groups.CONTENT_URI);
+ return new GroupListLoader(mContext);
}
@Override
@@ -190,64 +190,16 @@
if (mGroupListCursor == null) {
return;
}
- mGroupMap.clear();
- mGroupListCursor.moveToPosition(-1);
- while (mGroupListCursor.moveToNext()) {
- String accountName = mGroupListCursor.getString(GroupMetaDataLoader.ACCOUNT_NAME);
- String accountType = mGroupListCursor.getString(GroupMetaDataLoader.ACCOUNT_TYPE);
- long groupId = mGroupListCursor.getLong(GroupMetaDataLoader.GROUP_ID);
- String title = mGroupListCursor.getString(GroupMetaDataLoader.TITLE);
- boolean deleted =
- (mGroupListCursor.getInt(GroupMetaDataLoader.DELETED) == 1);
- boolean defaultGroup = mGroupListCursor.isNull(GroupMetaDataLoader.AUTO_ADD)
- ? false
- : mGroupListCursor.getInt(GroupMetaDataLoader.AUTO_ADD) != 0;
- boolean favorites = mGroupListCursor.isNull(GroupMetaDataLoader.FAVORITES)
- ? false
- : mGroupListCursor.getInt(GroupMetaDataLoader.FAVORITES) != 0;
-
- // Don't show the "auto-added" (i.e. My Contacts) or "favorites" groups because
- // they show up elsewhere in the app. Also skip groups that are marked as "deleted"
- if (defaultGroup || favorites || deleted) {
- continue;
- }
-
- GroupMetaData newGroup = new GroupMetaData(accountName, accountType, groupId, title,
- defaultGroup, favorites);
- Account account = new Account(accountName, accountType);
-
- if (mGroupMap.containsKey(account)) {
- List<GroupMetaData> groups = mGroupMap.get(account);
- groups.add(newGroup);
- } else {
- List<GroupMetaData> groups = new ArrayList<GroupMetaData>();
- groups.add(newGroup);
- mGroupMap.put(account, groups);
- }
-
- }
-
- mAdapter = new GroupBrowseListAdapter(mContext, mGroupMap);
- mAdapter.setSelectionVisible(mSelectionVisible);
- mAdapter.setSelectedGroup(mSelectedGroupUri);
+ mAdapter.setCursor(mGroupListCursor);
Parcelable listState = mListView.onSaveInstanceState();
- mListView.setAdapter(mAdapter);
- mListView.setEmptyView(mEmptyView);
- mListView.setOnItemClickListener(new OnItemClickListener() {
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- GroupListItem groupListItem = (GroupListItem) view;
- viewGroup(groupListItem.getUri());
- }
- });
-
if (mSelectionToScreenRequested) {
requestSelectionToScreen();
} else {
// Restore the scroll position.
mListView.onRestoreInstanceState(listState);
}
+ mListView.setEmptyView(mEmptyView);
if (mSelectionVisible && mSelectedGroupUri != null) {
viewGroup(mSelectedGroupUri);
@@ -260,6 +212,9 @@
public void setSelectionVisible(boolean flag) {
mSelectionVisible = flag;
+ if (mAdapter != null) {
+ mAdapter.setSelectionVisible(mSelectionVisible);
+ }
}
private void setSelectedGroup(Uri groupUri) {
diff --git a/src/com/android/contacts/group/GroupListItem.java b/src/com/android/contacts/group/GroupListItem.java
new file mode 100644
index 0000000..4740c44
--- /dev/null
+++ b/src/com/android/contacts/group/GroupListItem.java
@@ -0,0 +1,67 @@
+/*
+ * 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
+ */
+package com.android.contacts.group;
+
+/**
+ * Meta-data for a contact group. We load all groups associated with the contact's
+ * constituent accounts.
+ */
+public final class GroupListItem {
+ private final String mAccountName;
+ private final String mAccountType;
+ private final long mGroupId;
+ private final String mTitle;
+ private final boolean mIsFirstGroupInAccount;
+ private final int mMemberCount;
+
+ public GroupListItem(String accountName, String accountType, long groupId, String title,
+ boolean isFirstGroupInAccount, int memberCount) {
+ this.mAccountName = accountName;
+ this.mAccountType = accountType;
+ this.mGroupId = groupId;
+ this.mTitle = title;
+ this.mIsFirstGroupInAccount = isFirstGroupInAccount;
+ this.mMemberCount = memberCount;
+ }
+
+ public String getAccountName() {
+ return mAccountName;
+ }
+
+ public String getAccountType() {
+ return mAccountType;
+ }
+
+ public long getGroupId() {
+ return mGroupId;
+ }
+
+ public String getTitle() {
+ return mTitle;
+ }
+
+ public int getMemberCount() {
+ return mMemberCount;
+ }
+
+ public boolean hasMemberCount() {
+ return mMemberCount != -1;
+ }
+
+ public boolean isFirstGroupInAccount() {
+ return mIsFirstGroupInAccount;
+ }
+}
\ No newline at end of file
diff --git a/src/com/android/contacts/list/AccountFilterActivity.java b/src/com/android/contacts/list/AccountFilterActivity.java
index c38599e..24eab23 100644
--- a/src/com/android/contacts/list/AccountFilterActivity.java
+++ b/src/com/android/contacts/list/AccountFilterActivity.java
@@ -19,6 +19,7 @@
import com.android.contacts.ContactsActivity;
import com.android.contacts.ContactsSearchManager;
import com.android.contacts.R;
+import com.android.contacts.activities.PeopleActivity;
import com.android.contacts.model.AccountType;
import com.android.contacts.model.AccountTypeManager;
@@ -167,6 +168,9 @@
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
+ Intent intent = new Intent(this, PeopleActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(intent);
finish();
return true;
default: