Merge "Renamed references to INCLUDE_PROFILE."
diff --git a/res/drawable-xlarge-nodpi/divider_vertical_dark.9.png b/res/drawable-sw580dp-nodpi/divider_vertical_dark.9.png
similarity index 100%
rename from res/drawable-xlarge-nodpi/divider_vertical_dark.9.png
rename to res/drawable-sw580dp-nodpi/divider_vertical_dark.9.png
Binary files differ
diff --git a/res/layout-sw580dp-w1000dp/contact_detail_empty.xml b/res/layout-sw580dp-w1000dp/contact_detail_empty.xml
new file mode 100644
index 0000000..e12dd39
--- /dev/null
+++ b/res/layout-sw580dp-w1000dp/contact_detail_empty.xml
@@ -0,0 +1,36 @@
+<?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.
+-->
+
+<!-- Placeholder for empty details for a contact -->
+
+<com.android.contacts.widget.InterpolatingLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:ex="http://schemas.android.com/apk/res/com.android.contacts"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <TextView android:id="@+id/emptyText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/no_contact_details"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorSecondary"
+ ex:layout_wideParentWidth="800dip"
+ ex:layout_wideMarginLeft="80dip"
+ ex:layout_narrowParentWidth="500dip"
+ ex:layout_narrowMarginLeft="44dip"
+ android:paddingTop="10dip"
+ android:lineSpacingMultiplier="0.92"/>
+</com.android.contacts.widget.InterpolatingLayout>
\ No newline at end of file
diff --git a/res/layout-xlarge-land/contact_detail_header_view.xml b/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
similarity index 87%
rename from res/layout-xlarge-land/contact_detail_header_view.xml
rename to res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
index fb57202..82432a0 100644
--- a/res/layout-xlarge-land/contact_detail_header_view.xml
+++ b/res/layout-sw580dp-w1000dp/contact_detail_header_view.xml
@@ -25,7 +25,7 @@
<TextView
android:id="@+id/attribution"
android:layout_width="match_parent"
- android:layout_height="56dip"
+ android:layout_height="@dimen/detail_header_attribution_height"
android:paddingRight="16dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorTertiary"
@@ -60,7 +60,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16dip"
- android:layout_marginLeft="16dip">
+ android:layout_marginLeft="@dimen/detail_header_view_margin">
<!-- Star -->
<CheckBox
@@ -77,33 +77,24 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:paddingLeft="16dip"
+ android:paddingLeft="@dimen/detail_header_view_margin"
android:orientation="vertical">
<TextView
android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:ellipsize="end"
+ style="@style/ContactDetailHeaderTextView"
android:textSize="@dimen/contact_name_text_size" />
<TextView
android:id="@+id/phonetic_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ style="@style/ContactDetailHeaderTextView"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:singleLine="true"
- android:ellipsize="end"
android:layout_marginTop="-2dip"
android:visibility="gone" />
<TextView
android:id="@+id/organization"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:ellipsize="end"
+ style="@style/ContactDetailHeaderTextView"
android:layout_marginTop="-2dip"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceMedium"
diff --git a/res/layout-xlarge-land/contact_detail_list_item.xml b/res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
similarity index 100%
rename from res/layout-xlarge-land/contact_detail_list_item.xml
rename to res/layout-sw580dp-w1000dp/contact_detail_list_item.xml
diff --git a/res/layout-xlarge/account_selector_list_item.xml b/res/layout-sw580dp/account_selector_list_item.xml
similarity index 100%
rename from res/layout-xlarge/account_selector_list_item.xml
rename to res/layout-sw580dp/account_selector_list_item.xml
diff --git a/res/layout-xlarge/aggregation_suggestions.xml b/res/layout-sw580dp/aggregation_suggestions.xml
similarity index 100%
rename from res/layout-xlarge/aggregation_suggestions.xml
rename to res/layout-sw580dp/aggregation_suggestions.xml
diff --git a/res/layout-xlarge/aggregation_suggestions_item.xml b/res/layout-sw580dp/aggregation_suggestions_item.xml
similarity index 100%
rename from res/layout-xlarge/aggregation_suggestions_item.xml
rename to res/layout-sw580dp/aggregation_suggestions_item.xml
diff --git a/res/layout-xlarge/contact_detail_fragment.xml b/res/layout-sw580dp/contact_detail_fragment.xml
similarity index 70%
rename from res/layout-xlarge/contact_detail_fragment.xml
rename to res/layout-sw580dp/contact_detail_fragment.xml
index 4d6a900..3849277 100644
--- a/res/layout-xlarge/contact_detail_fragment.xml
+++ b/res/layout-sw580dp/contact_detail_fragment.xml
@@ -24,25 +24,10 @@
android:background="@drawable/panel_content">
<!-- Placeholder for empty list -->
- <com.android.contacts.widget.InterpolatingLayout
+ <include
android:id="@android:id/empty"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone">
- <TextView android:id="@+id/emptyText"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/no_contact_details"
- android:textSize="20sp"
- android:textColor="?android:attr/textColorSecondary"
- ex:layout_wideParentWidth="800dip"
- ex:layout_wideMarginLeft="64dip"
- ex:layout_narrowParentWidth="500dip"
- ex:layout_narrowMarginLeft="42dip"
- android:paddingTop="10dip"
- android:lineSpacingMultiplier="0.92"
- />
- </com.android.contacts.widget.InterpolatingLayout>
+ layout="@layout/contact_detail_empty"
+ android:visibility="gone" />
<!-- Real list -->
<com.android.contacts.widget.InterpolatingLayout
@@ -55,8 +40,8 @@
ex:layout_wideParentWidth="800dip"
ex:layout_wideMarginLeft="64dip"
ex:layout_widePaddingRight="48dip"
- ex:layout_narrowParentWidth="500dip"
- ex:layout_narrowMarginLeft="32dip"
+ ex:layout_narrowParentWidth="300dip"
+ ex:layout_narrowMarginLeft="5dip"
ex:layout_narrowPaddingRight="16dip"
android:cacheColorHint="#00000000"
android:divider="@null"
diff --git a/res/layout-large/contact_detail_header_view.xml b/res/layout-sw580dp/contact_detail_header_view.xml
similarity index 87%
rename from res/layout-large/contact_detail_header_view.xml
rename to res/layout-sw580dp/contact_detail_header_view.xml
index 19132dd..95a5617 100644
--- a/res/layout-large/contact_detail_header_view.xml
+++ b/res/layout-sw580dp/contact_detail_header_view.xml
@@ -25,7 +25,7 @@
<TextView
android:id="@+id/attribution"
android:layout_width="match_parent"
- android:layout_height="56dip"
+ android:layout_height="@dimen/detail_header_attribution_height"
android:paddingRight="24dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="?android:attr/textColorTertiary"
@@ -39,7 +39,7 @@
<ImageView
android:id="@+id/photo"
- android:layout_marginLeft="16dip"
+ android:layout_marginLeft="@dimen/detail_header_view_margin"
android:layout_width="96dip"
android:layout_height="96dip" />
@@ -60,7 +60,7 @@
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="16dip"
- android:layout_marginLeft="16dip">
+ android:layout_marginLeft="@dimen/detail_header_view_margin">>
<!-- Star -->
<CheckBox
@@ -77,31 +77,24 @@
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:paddingLeft="16dip"
+ android:paddingLeft="@dimen/detail_header_view_margin"
android:orientation="vertical">
<TextView
android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:singleLine="true"
- android:ellipsize="end"
+ style="@style/ContactDetailHeaderTextView"
android:textSize="@dimen/contact_name_text_size" />
<TextView
android:id="@+id/phonetic_name"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ style="@style/ContactDetailHeaderTextView"
android:textAppearance="?android:attr/textAppearanceMedium"
- android:singleLine="true"
- android:ellipsize="end"
android:layout_marginTop="-2dip"
android:visibility="gone" />
<TextView
android:id="@+id/organization"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
+ style="@style/ContactDetailHeaderTextView"
android:layout_marginTop="-2dip"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceMedium"
diff --git a/res/layout-xlarge/contact_editor_activity.xml b/res/layout-sw580dp/contact_editor_activity.xml
similarity index 100%
rename from res/layout-xlarge/contact_editor_activity.xml
rename to res/layout-sw580dp/contact_editor_activity.xml
diff --git a/res/layout-xlarge/contact_editor_fragment.xml b/res/layout-sw580dp/contact_editor_fragment.xml
similarity index 100%
rename from res/layout-xlarge/contact_editor_fragment.xml
rename to res/layout-sw580dp/contact_editor_fragment.xml
diff --git a/res/layout-xlarge/contact_picker_content.xml b/res/layout-sw580dp/contact_picker_content.xml
similarity index 100%
rename from res/layout-xlarge/contact_picker_content.xml
rename to res/layout-sw580dp/contact_picker_content.xml
diff --git a/res/layout-xlarge/edit_spinner.xml b/res/layout-sw580dp/edit_spinner.xml
similarity index 100%
rename from res/layout-xlarge/edit_spinner.xml
rename to res/layout-sw580dp/edit_spinner.xml
diff --git a/res/layout-xlarge/event_field_editor_view.xml b/res/layout-sw580dp/event_field_editor_view.xml
similarity index 100%
rename from res/layout-xlarge/event_field_editor_view.xml
rename to res/layout-sw580dp/event_field_editor_view.xml
diff --git a/res/layout-xlarge/external_raw_contact_editor_view.xml b/res/layout-sw580dp/external_raw_contact_editor_view.xml
similarity index 92%
rename from res/layout-xlarge/external_raw_contact_editor_view.xml
rename to res/layout-sw580dp/external_raw_contact_editor_view.xml
index 0304c48..b185c8a 100644
--- a/res/layout-xlarge/external_raw_contact_editor_view.xml
+++ b/res/layout-sw580dp/external_raw_contact_editor_view.xml
@@ -43,7 +43,7 @@
android:layout_gravity="top|left"
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginLeft="96dip"
- ex:layout_narrowParentWidth="800dip"
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
ex:layout_narrowMarginLeft="15dip">
<include
@@ -58,7 +58,7 @@
android:layout_gravity="top"
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginRight="48dip"
- ex:layout_narrowParentWidth="800dip"
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
ex:layout_narrowMarginRight="15dip"
android:orientation="vertical">
@@ -71,7 +71,7 @@
android:id="@+id/read_only_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="64dip"
+ android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
android:layout_marginRight="48dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="4dip"
@@ -91,7 +91,7 @@
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginLeft="96dip"
ex:layout_wideMarginRight="96dip"
- ex:layout_narrowParentWidth="800dip"
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
ex:layout_narrowMarginLeft="15dip"
ex:layout_narrowMarginRight="15dip">
@@ -132,7 +132,7 @@
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginLeft="246dip"
ex:layout_wideMarginRight="156dip"
- ex:layout_narrowParentWidth="800dip"
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
ex:layout_narrowMarginLeft="165dip"
ex:layout_narrowMarginRight="121dip"
android:layout_width="match_parent"
diff --git a/res/layout-xlarge/group_detail_fragment.xml b/res/layout-sw580dp/group_detail_fragment.xml
similarity index 100%
rename from res/layout-xlarge/group_detail_fragment.xml
rename to res/layout-sw580dp/group_detail_fragment.xml
diff --git a/res/layout-xlarge/item_group_membership.xml b/res/layout-sw580dp/item_group_membership.xml
similarity index 97%
rename from res/layout-xlarge/item_group_membership.xml
rename to res/layout-sw580dp/item_group_membership.xml
index 41d77b7..985b7ae 100644
--- a/res/layout-xlarge/item_group_membership.xml
+++ b/res/layout-sw580dp/item_group_membership.xml
@@ -24,7 +24,7 @@
<TextView
android:id="@+id/kind_title"
- android:layout_width="150dip"
+ android:layout_width="@dimen/editor_title_label_width"
android:layout_height="@dimen/editor_min_line_item_height"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceSmall"
diff --git a/res/layout-xlarge/item_kind_section.xml b/res/layout-sw580dp/item_kind_section.xml
similarity index 100%
rename from res/layout-xlarge/item_kind_section.xml
rename to res/layout-sw580dp/item_kind_section.xml
diff --git a/res/layout-xlarge/people_activity.xml b/res/layout-sw580dp/people_activity.xml
similarity index 100%
rename from res/layout-xlarge/people_activity.xml
rename to res/layout-sw580dp/people_activity.xml
diff --git a/res/layout-xlarge/phonetic_name_editor_view.xml b/res/layout-sw580dp/phonetic_name_editor_view.xml
similarity index 96%
rename from res/layout-xlarge/phonetic_name_editor_view.xml
rename to res/layout-sw580dp/phonetic_name_editor_view.xml
index c3fa6a3..f27c1fc 100644
--- a/res/layout-xlarge/phonetic_name_editor_view.xml
+++ b/res/layout-sw580dp/phonetic_name_editor_view.xml
@@ -21,7 +21,7 @@
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical"
android:paddingRight="?android:attr/scrollbarSize"
- android:layout_marginLeft="52dip"
+ android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
android:layout_marginRight="48dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="4dip">
diff --git a/res/layout-xlarge/raw_contact_editor_header.xml b/res/layout-sw580dp/raw_contact_editor_header.xml
similarity index 100%
rename from res/layout-xlarge/raw_contact_editor_header.xml
rename to res/layout-sw580dp/raw_contact_editor_header.xml
diff --git a/res/layout-xlarge/raw_contact_editor_view.xml b/res/layout-sw580dp/raw_contact_editor_view.xml
similarity index 87%
rename from res/layout-xlarge/raw_contact_editor_view.xml
rename to res/layout-sw580dp/raw_contact_editor_view.xml
index 0e3d227..9c3f708 100644
--- a/res/layout-xlarge/raw_contact_editor_view.xml
+++ b/res/layout-sw580dp/raw_contact_editor_view.xml
@@ -48,8 +48,8 @@
android:layout_gravity="top|left"
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginLeft="96dip"
- ex:layout_narrowParentWidth="800dip"
- ex:layout_narrowMarginLeft="15dip">
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
+ ex:layout_narrowMarginLeft="20dip">
<include
android:id="@+id/edit_photo"
@@ -63,8 +63,10 @@
android:layout_gravity="top"
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginRight="48dip"
- ex:layout_narrowParentWidth="800dip"
+ ex:layout_wideMarginLeft="10dip"
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
ex:layout_narrowMarginRight="15dip"
+ ex:layout_narrowMarginLeft="5dip"
android:orientation="vertical">
<View
@@ -83,7 +85,7 @@
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginLeft="52dip"
+ android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
android:layout_marginRight="48dip">
<ViewStub
android:id="@+id/aggregation_suggestion_stub"
@@ -106,16 +108,16 @@
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginLeft="96dip"
ex:layout_wideMarginRight="48dip"
- ex:layout_narrowParentWidth="800dip"
- ex:layout_narrowMarginLeft="15dip"
- ex:layout_narrowMarginRight="15dip">
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
+ ex:layout_narrowMarginLeft="25dip"
+ ex:layout_narrowMarginRight="10dip">
<LinearLayout
android:id="@+id/sect_fields"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- android:paddingRight="?android:attr/scrollbarSize" />
+ android:paddingRight="@dimen/editor_name_text_field_right_margin" />
</LinearLayout>
</com.android.contacts.widget.InterpolatingLayout>
@@ -130,7 +132,7 @@
ex:layout_wideParentWidth="960dip"
ex:layout_wideMarginLeft="246dip"
ex:layout_wideMarginRight="156dip"
- ex:layout_narrowParentWidth="800dip"
+ ex:layout_narrowParentWidth="@dimen/editor_interpolator_narrow_width"
ex:layout_narrowMarginLeft="165dip"
ex:layout_narrowMarginRight="121dip"
android:layout_width="match_parent"
diff --git a/res/layout-xlarge/search_header.xml b/res/layout-sw580dp/search_header.xml
similarity index 100%
rename from res/layout-xlarge/search_header.xml
rename to res/layout-sw580dp/search_header.xml
diff --git a/res/layout-xlarge/structured_name_editor_view.xml b/res/layout-sw580dp/structured_name_editor_view.xml
similarity index 96%
rename from res/layout-xlarge/structured_name_editor_view.xml
rename to res/layout-sw580dp/structured_name_editor_view.xml
index 37b5536..97e222e 100644
--- a/res/layout-xlarge/structured_name_editor_view.xml
+++ b/res/layout-sw580dp/structured_name_editor_view.xml
@@ -21,7 +21,7 @@
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical"
android:paddingRight="?android:attr/scrollbarSize"
- android:layout_marginLeft="52dip"
+ android:layout_marginLeft="@dimen/editor_name_text_field_left_margin"
android:layout_marginRight="48dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="4dip">
diff --git a/res/layout-xlarge/text_fields_editor_view.xml b/res/layout-sw580dp/text_fields_editor_view.xml
similarity index 100%
rename from res/layout-xlarge/text_fields_editor_view.xml
rename to res/layout-sw580dp/text_fields_editor_view.xml
diff --git a/res/layout-xlarge/total_contacts.xml b/res/layout-sw580dp/total_contacts.xml
similarity index 100%
rename from res/layout-xlarge/total_contacts.xml
rename to res/layout-sw580dp/total_contacts.xml
diff --git a/res/layout-w470dp/contact_detail_activity.xml b/res/layout-w470dp/contact_detail_activity.xml
new file mode 100644
index 0000000..bf649a2
--- /dev/null
+++ b/res/layout-w470dp/contact_detail_activity.xml
@@ -0,0 +1,29 @@
+<?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.
+-->
+
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/contact_detail_view"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <com.android.contacts.detail.ContactDetailFragmentCarousel
+ android:id="@+id/fragment_carousel"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+
+</FrameLayout>
diff --git a/res/layout-w470dp/contact_detail_fragment.xml b/res/layout-w470dp/contact_detail_fragment.xml
new file mode 100644
index 0000000..64fec60
--- /dev/null
+++ b/res/layout-w470dp/contact_detail_fragment.xml
@@ -0,0 +1,92 @@
+<?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.
+-->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/contact_detail"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <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="100dip"
+ android:layout_height="100dip"
+ 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>
+
+ <ScrollView android:id="@android:id/empty"
+ android:layout_width="match_parent"
+ android:layout_height="0px"
+ android:layout_weight="1"
+ android:visibility="gone">
+ <TextView android:id="@+id/emptyText"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/no_contact_details"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorSecondary"
+ android:paddingLeft="10dip"
+ android:paddingRight="10dip"
+ android:paddingTop="10dip"
+ android:lineSpacingMultiplier="0.92"/>
+ </ScrollView>
+
+ <!-- "Copy to my contacts"- button -->
+ <Button
+ android:id="@+id/copyLocal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/menu_copyContact"
+ android:visibility="gone"
+ android:layout_gravity="right"
+ android:layout_marginRight="40dip"
+ android:layout_marginTop="20dip"
+ android:layout_marginBottom="20dip" />
+
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="@android:color/black"
+ android:alpha=".50"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentTop="true"
+ android:background="@android:color/transparent"
+ android:visibility="gone"/>
+</RelativeLayout>
+
diff --git a/res/layout/contact_detail_empty.xml b/res/layout/contact_detail_empty.xml
new file mode 100644
index 0000000..755c069
--- /dev/null
+++ b/res/layout/contact_detail_empty.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.
+-->
+
+<!-- Placeholder for empty details for a contact -->
+
+<TextView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/no_contact_details"
+ android:textSize="20sp"
+ android:textColor="?android:attr/textColorSecondary"
+ android:layout_marginLeft="15dip"
+ android:paddingTop="10dip"
+ android:lineSpacingMultiplier="0.92"/>
\ No newline at end of file
diff --git a/res/layout/contact_detail_fragment_carousel.xml b/res/layout/contact_detail_fragment_carousel.xml
new file mode 100644
index 0000000..165b6a1
--- /dev/null
+++ b/res/layout/contact_detail_fragment_carousel.xml
@@ -0,0 +1,34 @@
+<?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"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scrollbars="none"
+ android:orientation="horizontal">
+
+ <fragment class="com.android.contacts.detail.ContactDetailAboutFragment"
+ android:id="@+id/about_fragment"
+ android:layout_width="@dimen/detail_fragment_carousel_fragment_width"
+ android:layout_height="match_parent" />
+
+ <fragment class="com.android.contacts.detail.ContactDetailUpdatesFragment"
+ android:id="@+id/updates_fragment"
+ android:layout_width="@dimen/detail_fragment_carousel_fragment_width"
+ android:layout_height="match_parent" />
+
+</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/contact_detail_updates_fragment.xml b/res/layout/contact_detail_updates_fragment.xml
index f60be2a..daa5608 100644
--- a/res/layout/contact_detail_updates_fragment.xml
+++ b/res/layout/contact_detail_updates_fragment.xml
@@ -14,7 +14,7 @@
limitations under the License.
-->
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contact_detail"
android:orientation="vertical"
android:layout_width="match_parent"
@@ -30,5 +30,20 @@
android:paddingRight="10dip"
android:paddingTop="@dimen/detail_tab_carousel_height"
android:layout_marginTop="10dip"/>
-</LinearLayout>
+
+ <View
+ android:id="@+id/alpha_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/black"
+ android:alpha=".50"
+ android:visibility="gone"/>
+
+ <View
+ android:id="@+id/touch_intercept_overlay"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/transparent"
+ android:visibility="gone"/>
+</FrameLayout>
diff --git a/res/menu-xlarge/actions.xml b/res/menu-sw580dp-w720dp/actions.xml
similarity index 100%
rename from res/menu-xlarge/actions.xml
rename to res/menu-sw580dp-w720dp/actions.xml
diff --git a/res/menu-xlarge/view_contact.xml b/res/menu-sw580dp-w720dp/view_contact.xml
similarity index 100%
rename from res/menu-xlarge/view_contact.xml
rename to res/menu-sw580dp-w720dp/view_contact.xml
diff --git a/res/menu-xlarge/view_group.xml b/res/menu-sw580dp-w720dp/view_group.xml
similarity index 100%
rename from res/menu-xlarge/view_group.xml
rename to res/menu-sw580dp-w720dp/view_group.xml
diff --git a/res/menu-sw580dp/actions.xml b/res/menu-sw580dp/actions.xml
new file mode 100644
index 0000000..4fe669a
--- /dev/null
+++ b/res/menu-sw580dp/actions.xml
@@ -0,0 +1,54 @@
+<?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.
+-->
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_search"
+ android:showAsAction="always"
+ android:actionViewClass="android.widget.SearchView" />
+
+ <item
+ android:id="@+id/menu_add_contact"
+ android:icon="@drawable/ic_menu_add_contact_holo_light"
+ android:title="@string/menu_new_contact_action_bar"
+ android:showAsAction="withText" />
+
+ <item
+ android:id="@+id/menu_add_group"
+ android:icon="@drawable/ic_menu_display_all_holo_light"
+ android:title="@string/menu_new_contact_action_bar"
+ android:showAsAction="withText" />
+
+ <item
+ android:id="@+id/menu_contacts_filter"
+ android:icon="@drawable/ic_menu_settings_holo_light"
+ android:title="@string/menu_contacts_filter" />
+
+ <item
+ android:id="@+id/menu_settings"
+ android:icon="@drawable/ic_menu_settings_holo_light"
+ android:title="@string/menu_settings" />
+
+ <item
+ android:id="@+id/menu_accounts"
+ android:icon="@drawable/ic_menu_accounts_holo_light"
+ android:title="@string/menu_accounts" />
+
+ <item
+ android:id="@+id/menu_import_export"
+ android:icon="@drawable/ic_menu_import_export_holo_light"
+ android:title="@string/menu_import_export" />
+
+</menu>
diff --git a/res/menu-sw580dp/view_contact.xml b/res/menu-sw580dp/view_contact.xml
new file mode 100644
index 0000000..542cfe3
--- /dev/null
+++ b/res/menu-sw580dp/view_contact.xml
@@ -0,0 +1,39 @@
+<?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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_edit"
+ android:icon="@drawable/ic_menu_compose_holo_light"
+ android:title="@string/menu_editContact"
+ android:alphabeticShortcut="e" />
+
+ <item
+ android:id="@+id/menu_share"
+ android:icon="@drawable/ic_menu_share_holo_light"
+ android:title="@string/menu_share"
+ android:alphabeticShortcut="s" />
+
+ <item
+ android:id="@+id/menu_options"
+ android:icon="@drawable/ic_menu_mark"
+ android:title="@string/menu_contactOptions" />
+
+ <item
+ android:id="@+id/menu_delete"
+ android:icon="@drawable/ic_menu_trash_holo_light"
+ android:title="@string/menu_deleteContact" />
+</menu>
diff --git a/res/menu-sw580dp/view_group.xml b/res/menu-sw580dp/view_group.xml
new file mode 100644
index 0000000..3ff6ac6
--- /dev/null
+++ b/res/menu-sw580dp/view_group.xml
@@ -0,0 +1,33 @@
+<?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.
+-->
+
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/menu_edit_group"
+ android:icon="@drawable/ic_menu_compose_holo_light"
+ android:title="@string/menu_editGroup"
+ android:alphabeticShortcut="e" />
+
+ <item
+ android:id="@+id/menu_rename_group"
+ android:icon="@drawable/ic_menu_settings_holo_light"
+ android:title="@string/menu_renameGroup" />
+
+ <item
+ android:id="@+id/menu_delete_group"
+ android:icon="@drawable/ic_menu_trash_holo_light"
+ android:title="@string/menu_deleteGroup" />
+</menu>
diff --git a/res/values-xlarge-land/dimens.xml b/res/values-sw580dp-w1000dp/dimens.xml
similarity index 88%
rename from res/values-xlarge-land/dimens.xml
rename to res/values-sw580dp-w1000dp/dimens.xml
index 52c521e..45da0a8 100644
--- a/res/values-xlarge-land/dimens.xml
+++ b/res/values-sw580dp-w1000dp/dimens.xml
@@ -19,4 +19,6 @@
<dimen name="action_bar_filter_max_width">300dip</dimen>
<dimen name="action_bar_search_max_width">336dip</dimen>
<dimen name="action_bar_search_spacing">32dip</dimen>
+ <dimen name="detail_header_view_margin">16dip</dimen>
+ <dimen name="detail_header_attribution_height">56dip</dimen>
</resources>
diff --git a/res/values-sw580dp-w720dp/dimens.xml b/res/values-sw580dp-w720dp/dimens.xml
new file mode 100644
index 0000000..a8aedb8
--- /dev/null
+++ b/res/values-sw580dp-w720dp/dimens.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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.
+-->
+<resources>
+ <dimen name="editor_type_label_width">180dip</dimen>
+ <dimen name="editor_round_button_padding_left">8dip</dimen>
+ <dimen name="editor_round_button_padding_right">8dip</dimen>
+ <dimen name="editor_name_text_field_left_margin">52dip</dimen>
+ <dimen name="editor_title_label_width">150dip</dimen>
+ <dimen name="editor_interpolator_narrow_width">800dip</dimen>
+ <dimen name="editor_name_text_field_right_margin">10dip</dimen>
+</resources>
\ No newline at end of file
diff --git a/res/values-sw580dp-w720dp/styles.xml b/res/values-sw580dp-w720dp/styles.xml
new file mode 100644
index 0000000..3b7ed4e
--- /dev/null
+++ b/res/values-sw580dp-w720dp/styles.xml
@@ -0,0 +1,49 @@
+<?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.
+-->
+<resources>
+ <style name="PeopleTheme" parent="@android:Theme.Holo.Light">
+ <item name="list_item_height">66dip</item>
+ <item name="activated_background">@drawable/list_item_activated_background</item>
+ <item name="android:windowContentOverlay">@null</item>
+ <item name="android:actionBarStyle">@style/TransparentActionBarStyle</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_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_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_photo_size">64dip</item>
+ <item name="list_item_profile_photo_size">80dip</item>
+ <item name="list_item_prefix_highlight_color">#729a27</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_size">14sp</item>
+ <item name="contact_filter_popup_width">320dip</item>
+ <item name="show_home_icon">true</item>
+ </style>
+
+ <style name="ContactDetailHeaderTextView">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ <item name="android:singleLine">true</item>
+ <item name="android:ellipsize">end</item>
+ </style>
+</resources>
\ No newline at end of file
diff --git a/res/values-xlarge/colors.xml b/res/values-sw580dp/colors.xml
similarity index 100%
rename from res/values-xlarge/colors.xml
rename to res/values-sw580dp/colors.xml
diff --git a/res/values-xlarge/dimens.xml b/res/values-sw580dp/dimens.xml
similarity index 100%
rename from res/values-xlarge/dimens.xml
rename to res/values-sw580dp/dimens.xml
diff --git a/res/values-xlarge/donottranslate_config.xml b/res/values-sw580dp/donottranslate_config.xml
similarity index 100%
rename from res/values-xlarge/donottranslate_config.xml
rename to res/values-sw580dp/donottranslate_config.xml
diff --git a/res/values-xlarge/styles.xml b/res/values-sw580dp/styles.xml
similarity index 95%
rename from res/values-xlarge/styles.xml
rename to res/values-sw580dp/styles.xml
index cbef91a..b34efcc 100644
--- a/res/values-xlarge/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -22,14 +22,14 @@
<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">20dip</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_prefix_highlight_color">#729a27</item>
@@ -65,7 +65,7 @@
<style name="CustomContactListFilterView" parent="CustomContactListFilterTheme">
<item name="android:layout_width">400dip</item>
- <item name="android:layout_height">600dip</item>
+ <item name="android:layout_height">400dip</item>
</style>
<style name="ContactPickerLayout" parent="ContactPickerTheme">
diff --git a/res/values-xlarge-land/dimens.xml b/res/values-w470dp/dimens.xml
similarity index 70%
copy from res/values-xlarge-land/dimens.xml
copy to res/values-w470dp/dimens.xml
index 52c521e..ba7f3f8 100644
--- a/res/values-xlarge-land/dimens.xml
+++ b/res/values-w470dp/dimens.xml
@@ -14,9 +14,5 @@
limitations under the License.
-->
<resources>
- <dimen name="quick_contact_width">452dip</dimen>
- <dimen name="action_bar_filter_min_width">220dip</dimen>
- <dimen name="action_bar_filter_max_width">300dip</dimen>
- <dimen name="action_bar_search_max_width">336dip</dimen>
- <dimen name="action_bar_search_spacing">32dip</dimen>
+ <dimen name="detail_tab_carousel_height">0dip</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 9525f54..3e5b554 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -38,8 +38,8 @@
<dimen name="quick_contact_width">352dip</dimen>
<!-- Padding of the rounded plus/minus/expand/collapse buttons in the editor -->
- <dimen name="editor_round_button_padding_left">4dip</dimen>
- <dimen name="editor_round_button_padding_right">4dip</dimen>
+ <dimen name="editor_round_button_padding_left">2dip</dimen>
+ <dimen name="editor_round_button_padding_right">2dip</dimen>
<dimen name="editor_round_button_padding_top">8dip</dimen>
<dimen name="editor_round_button_padding_bottom">8dip</dimen>
@@ -70,6 +70,24 @@
<!-- Font size for the entries in a spinner in the contact editor. -->
<dimen name="editor_field_spinner_text_size">10sp</dimen>
+ <!-- Left margin of the name text input fields and the photo in the contact editor -->
+ <dimen name="editor_name_text_field_left_margin">25dip</dimen>
+
+ <!-- Right margin of the text input fields in the contact editor -->
+ <dimen name="editor_name_text_field_right_margin">0dip</dimen>
+
+ <!-- Width of the title labels in the contact editor -->
+ <dimen name="editor_title_label_width">120dip</dimen>
+
+ <!-- Interpolator layout narrow width value of the contact editor -->
+ <dimen name="editor_interpolator_narrow_width">600dip</dimen>
+
+ <!-- Height of the attribution text view in the contact detail header view -->
+ <dimen name="detail_header_attribution_height">40dip</dimen>
+
+ <!-- Margin between the photo, the star, and text in the contact detail header view -->
+ <dimen name="detail_header_view_margin">8dip</dimen>
+
<!-- Height of the tab carousel on the contact detail page -->
<dimen name="detail_tab_carousel_height">150dip</dimen>
@@ -79,12 +97,18 @@
<!-- Height of the tab text label in the tab carousel on the contact detail page -->
<dimen name="detail_tab_carousel_tab_label_height">40dip</dimen>
+ <!-- Width of one fragment in the fragment carousel on the contact detail page -->
+ <dimen name="detail_fragment_carousel_fragment_width">420dip</dimen>
+
<!-- Vertical margin of the text within the update tab in the tab carousel -->
<dimen name="detail_update_tab_vertical_margin">20dip</dimen>
<!-- Left and right padding of the text within the update tab in the tab carousel -->
<dimen name="detail_update_tab_side_padding">10dip</dimen>
+ <!-- Margin around the contact's photo on the contact card -->
+ <dimen name="detail_contact_photo_margin">15dip</dimen>
+
<!-- Left and right padding for a contact detail item -->
<dimen name="detail_item_icon_margin">10dip</dimen>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 8fd42b7..51d8a0d 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -268,6 +268,11 @@
<item name="android:layout_width">match_parent</item>
</style>
+ <style name="ContactDetailHeaderTextView">
+ <item name="android:layout_width">match_parent</item>
+ <item name="android:layout_height">wrap_content</item>
+ </style>
+
<style name="ContactDetailItemType">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
diff --git a/src/com/android/contacts/activities/ContactDetailActivity.java b/src/com/android/contacts/activities/ContactDetailActivity.java
index 1488bec..c62084b 100644
--- a/src/com/android/contacts/activities/ContactDetailActivity.java
+++ b/src/com/android/contacts/activities/ContactDetailActivity.java
@@ -23,11 +23,10 @@
import com.android.contacts.R;
import com.android.contacts.detail.ContactDetailAboutFragment;
import com.android.contacts.detail.ContactDetailFragment;
-import com.android.contacts.detail.ContactDetailHeaderView;
+import com.android.contacts.detail.ContactDetailFragmentCarousel;
import com.android.contacts.detail.ContactDetailTabCarousel;
import com.android.contacts.detail.ContactDetailUpdatesFragment;
import com.android.contacts.interactions.ContactDeletionInteraction;
-import com.android.contacts.list.ContactBrowseListFragment;
import com.android.contacts.util.PhoneCapabilityTester;
import android.accounts.Account;
@@ -43,9 +42,7 @@
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.util.Log;
import android.view.KeyEvent;
-import android.view.MotionEvent;
import android.view.View;
-import android.view.View.OnTouchListener;
import android.widget.AbsListView;
import android.widget.AbsListView.OnScrollListener;
import android.widget.Toast;
@@ -63,12 +60,11 @@
private ContactDetailTabCarousel mTabCarousel;
private ViewPager mViewPager;
- private Uri mUri;
+ private ContactDetailFragmentCarousel mFragmentCarousel;
@Override
public void onCreate(Bundle savedState) {
super.onCreate(savedState);
-
if (PhoneCapabilityTester.isUsingTwoPanes(this)) {
// This activity must not be shown. We have to select the contact in the
// PeopleActivity instead ==> Create a forward intent and finish
@@ -88,25 +84,35 @@
setContentView(R.layout.contact_detail_activity);
+ // Narrow width screens have a {@link ViewPager} and {@link ContactDetailTabCarousel}
mViewPager = (ViewPager) findViewById(R.id.pager);
- mViewPager.setAdapter(new ViewPagerAdapter(getFragmentManager()));
- mViewPager.setOnPageChangeListener(mOnPageChangeListener);
+ if (mViewPager != null) {
+ mViewPager.setAdapter(new ViewPagerAdapter(getFragmentManager()));
+ mViewPager.setOnPageChangeListener(mOnPageChangeListener);
+ }
mTabCarousel = (ContactDetailTabCarousel) findViewById(R.id.tab_carousel);
- mTabCarousel.setListener(mTabCarouselListener);
+ if (mTabCarousel != null) {
+ mTabCarousel.setListener(mTabCarouselListener);
+ }
- mUri = getIntent().getData();
+ // Otherwise, wide width screens have a {@link ContactDetailFragmentCarousel}
+ mFragmentCarousel = (ContactDetailFragmentCarousel) findViewById(R.id.fragment_carousel);
+ if (mFragmentCarousel != null) {
+ if (mAboutFragment != null) mFragmentCarousel.setAboutFragment(mAboutFragment);
+ if (mUpdatesFragment != null) mFragmentCarousel.setUpdatesFragment(mUpdatesFragment);
+ }
+
Log.i(TAG, getIntent().getData().toString());
}
-
@Override
public void onAttachFragment(Fragment fragment) {
if (fragment instanceof ContactDetailAboutFragment) {
mAboutFragment = (ContactDetailAboutFragment) fragment;
mAboutFragment.setListener(mFragmentListener);
mAboutFragment.setVerticalScrollListener(mVerticalScrollListener);
- mAboutFragment.loadUri(mUri);
+ mAboutFragment.loadUri(getIntent().getData());
} else if (fragment instanceof ContactDetailUpdatesFragment) {
mUpdatesFragment = (ContactDetailUpdatesFragment) fragment;
}
@@ -125,7 +131,7 @@
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
FragmentKeyListener mCurrentFragment;
- switch (mViewPager.getCurrentItem()) {
+ switch (getCurrentPage()) {
case 0:
mCurrentFragment = (FragmentKeyListener) mAboutFragment;
break;
@@ -140,6 +146,16 @@
return super.onKeyDown(keyCode, event);
}
+ private int getCurrentPage() {
+ if (mViewPager != null) {
+ return mViewPager.getCurrentItem();
+ } else if (mFragmentCarousel != null) {
+ return mFragmentCarousel.getCurrentPage();
+ }
+ throw new IllegalStateException("Can't figure out the currently selected page. The activity"
+ + "must either have the ViewPager or fragment carousel");
+ }
+
private final ContactDetailFragment.Listener mFragmentListener =
new ContactDetailFragment.Listener() {
@Override
@@ -149,7 +165,9 @@
@Override
public void onDetailsLoaded(ContactLoader.Result result) {
- mTabCarousel.loadData(result);
+ if (mTabCarousel != null) {
+ mTabCarousel.loadData(result);
+ }
}
@Override
@@ -278,6 +296,9 @@
@Override
public void onScroll(
AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
+ if (mTabCarousel == null) {
+ return;
+ }
// Only re-position the tab carousel vertically if the FIRST item is still visible on
// the screen, otherwise the carousel should be in the correct place (pinned at the
// top).
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index 55acdad..548faa2 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -119,6 +119,9 @@
private GroupDetailFragment mGroupDetailFragment;
+ private StrequentContactListFragment.Listener mFavoritesFragmentListener =
+ new StrequentContactListFragmentListener();
+
private boolean mSearchInitiated;
private ContactListFilterController mContactListFilterController;
@@ -176,6 +179,9 @@
} else if (fragment instanceof GroupDetailFragment) {
mGroupDetailFragment = (GroupDetailFragment) fragment;
mContentPaneDisplayed = true;
+ } else if (fragment instanceof StrequentContactListFragment) {
+ mFavoritesFragment = (StrequentContactListFragment) fragment;
+ mFavoritesFragment.setListener(mFavoritesFragmentListener);
}
}
@@ -740,6 +746,18 @@
}
}
+ private final class StrequentContactListFragmentListener
+ implements StrequentContactListFragment.Listener {
+ @Override
+ public void onContactSelected(Uri contactUri) {
+ if (mContentPaneDisplayed) {
+ setupContactDetailFragment(contactUri);
+ } else {
+ startActivity(new Intent(Intent.ACTION_VIEW, contactUri));
+ }
+ }
+ }
+
private final class GroupBrowserActionListener implements OnGroupBrowserActionListener {
@Override
diff --git a/src/com/android/contacts/detail/ContactDetailAboutFragment.java b/src/com/android/contacts/detail/ContactDetailAboutFragment.java
index a1377e8..fc6b9cb 100644
--- a/src/com/android/contacts/detail/ContactDetailAboutFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailAboutFragment.java
@@ -19,20 +19,12 @@
import com.android.contacts.ContactLoader;
import com.android.contacts.R;
-import android.accounts.Account;
import android.app.ActionBar;
import android.app.Activity;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.net.Uri;
-import android.text.TextUtils;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
-import java.util.ArrayList;
-
public class ContactDetailAboutFragment extends ContactDetailFragment {
private static final String TAG = "ContactDetailAboutFragment";
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 74c05a5..c2aaea4 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -109,7 +109,7 @@
import java.util.Collections;
import java.util.List;
-public class ContactDetailFragment extends Fragment implements FragmentKeyListener,
+public class ContactDetailFragment extends Fragment implements FragmentKeyListener, FragmentOverlay,
OnItemClickListener, OnItemLongClickListener, SelectAccountDialogFragment.Listener {
private static final String TAG = "ContactDetailFragment";
@@ -128,6 +128,7 @@
private ContactLoader.Result mContactData;
private ContactDetailHeaderView mHeaderView;
+ private ImageView mPhotoView;
private ListView mListView;
private ViewAdapter mAdapter;
private Uri mPrimaryPhoneUri = null;
@@ -166,6 +167,17 @@
private View mEmptyView;
/**
+ * This optional view adds an alpha layer over the entire fragment.
+ */
+ private View mAlphaLayer;
+
+ /**
+ * This optional view adds a layer over the entire fragment so that when visible, it intercepts
+ * all touch events on the fragment.
+ */
+ private View mTouchInterceptLayer;
+
+ /**
* A list of distinct contact IDs included in the current contact.
*/
private ArrayList<Long> mRawContactIds = new ArrayList<Long>();
@@ -233,6 +245,8 @@
mInflater = inflater;
+ mPhotoView = (ImageView) mView.findViewById(R.id.photo);
+
mListView = (ListView) mView.findViewById(android.R.id.list);
mListView.setScrollBarStyle(ListView.SCROLLBARS_OUTSIDE_OVERLAY);
mListView.setOnItemClickListener(this);
@@ -242,6 +256,9 @@
// Don't set it to mListView yet. We do so later when we bind the adapter.
mEmptyView = mView.findViewById(android.R.id.empty);
+ mAlphaLayer = mView.findViewById(R.id.alpha_overlay);
+ mTouchInterceptLayer = mView.findViewById(R.id.touch_intercept_overlay);
+
mCopyGalToLocalButton = (Button) mView.findViewById(R.id.copyLocal);
mCopyGalToLocalButton.setOnClickListener(new OnClickListener() {
@Override
@@ -262,6 +279,35 @@
mListener = value;
}
+ @Override
+ public void setAlphaLayerValue(float alpha) {
+ if (mAlphaLayer != null) {
+ mAlphaLayer.setAlpha(alpha);
+ }
+ }
+
+ @Override
+ public void enableAlphaLayer() {
+ if (mAlphaLayer != null) {
+ mAlphaLayer.setVisibility(View.VISIBLE);
+ }
+ }
+
+ @Override
+ public void enableTouchInterceptor(OnClickListener clickListener) {
+ if (mTouchInterceptLayer != null) {
+ mTouchInterceptLayer.setVisibility(View.VISIBLE);
+ mTouchInterceptLayer.setOnClickListener(clickListener);
+ }
+ }
+
+ @Override
+ public void disableTouchInterceptor() {
+ if (mTouchInterceptLayer != null) {
+ mTouchInterceptLayer.setVisibility(View.GONE);
+ }
+ }
+
protected Context getContext() {
return mContext;
}
@@ -335,6 +381,11 @@
// Clear old header
mHeaderView = null;
+ // Setup the photo if applicable
+ if (mPhotoView != null) {
+ ContactDetailDisplayUtils.setPhoto(mContext, mContactData, mPhotoView);
+ }
+
// Build up the contact entries
buildEntries();
diff --git a/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java b/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
new file mode 100644
index 0000000..da64c34
--- /dev/null
+++ b/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
@@ -0,0 +1,219 @@
+/*
+ * 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.detail;
+
+import com.android.contacts.R;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnTouchListener;
+import android.widget.HorizontalScrollView;
+
+/**
+ * This is a horizontally scrolling carousel with 2 fragments: one to see info about the contact and
+ * one to see updates from the contact. Depending on the scroll position and user selection of which
+ * fragment to currently view, the alpha values and touch interceptors over each fragment are
+ * configured accordingly.
+ */
+public class ContactDetailFragmentCarousel extends HorizontalScrollView implements OnTouchListener {
+
+ private static final String TAG = ContactDetailFragmentCarousel.class.getSimpleName();
+
+ private int mAllowedHorizontalScrollLength = Integer.MIN_VALUE;
+ private int mLowerThreshold = Integer.MIN_VALUE;
+ private int mUpperThreshold = Integer.MIN_VALUE;
+
+ private static final int ABOUT_PAGE = 0;
+ private static final int UPDATES_PAGE = 1;
+
+ private int mCurrentPage = ABOUT_PAGE;
+ private int mLastScrollPosition;
+
+ private FragmentOverlay mAboutFragment;
+ private FragmentOverlay mUpdatesFragment;
+
+ private static final float MAX_ALPHA = 0.5f;
+
+ public ContactDetailFragmentCarousel(Context context) {
+ this(context, null);
+ }
+
+ public ContactDetailFragmentCarousel(Context context, AttributeSet attrs) {
+ this(context, attrs, 0);
+ }
+
+ public ContactDetailFragmentCarousel(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+
+ final LayoutInflater inflater =
+ (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ inflater.inflate(R.layout.contact_detail_fragment_carousel, this);
+
+ setOnTouchListener(this);
+ }
+
+ public void setAboutFragment(FragmentOverlay fragment) {
+ // TODO: We can't always assume the "about" page will be the current page.
+ mAboutFragment = fragment;
+ mAboutFragment.enableAlphaLayer();
+ mAboutFragment.setAlphaLayerValue(0);
+ mAboutFragment.disableTouchInterceptor();
+ }
+
+ public void setUpdatesFragment(FragmentOverlay fragment) {
+ mUpdatesFragment = fragment;
+ mUpdatesFragment.enableAlphaLayer();
+ mUpdatesFragment.setAlphaLayerValue(MAX_ALPHA);
+ mUpdatesFragment.enableTouchInterceptor(mUpdatesFragTouchInterceptListener);
+ }
+
+ public int getCurrentPage() {
+ return mCurrentPage;
+ }
+
+ private final OnClickListener mAboutFragTouchInterceptListener = new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mCurrentPage = ABOUT_PAGE;
+ snapToEdge();
+ }
+ };
+
+ private final OnClickListener mUpdatesFragTouchInterceptListener = new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mCurrentPage = UPDATES_PAGE;
+ snapToEdge();
+ }
+ };
+
+ private void updateTouchInterceptors() {
+ switch (mCurrentPage) {
+ case ABOUT_PAGE:
+ // The "about this contact" page has been selected, so disable the touch interceptor
+ // on this page and enable it for the "updates" page.
+ mAboutFragment.disableTouchInterceptor();
+ mUpdatesFragment.enableTouchInterceptor(mUpdatesFragTouchInterceptListener);
+ break;
+ case UPDATES_PAGE:
+ mUpdatesFragment.disableTouchInterceptor();
+ mAboutFragment.enableTouchInterceptor(mAboutFragTouchInterceptListener);
+ break;
+ }
+ }
+
+ private void updateAlphaLayers() {
+ mAboutFragment.setAlphaLayerValue(mLastScrollPosition * MAX_ALPHA /
+ getAllowedHorizontalScrollLength());
+ mUpdatesFragment.setAlphaLayerValue(MAX_ALPHA - mLastScrollPosition * MAX_ALPHA /
+ getAllowedHorizontalScrollLength());
+ }
+
+ @Override
+ protected void onScrollChanged(int l, int t, int oldl, int oldt) {
+ super.onScrollChanged(l, t, oldl, oldt);
+ mLastScrollPosition= l;
+ updateAlphaLayers();
+ }
+
+ private void snapToEdge() {
+ switch (mCurrentPage) {
+ case ABOUT_PAGE:
+ smoothScrollTo(0, 0);
+ break;
+ case UPDATES_PAGE:
+ smoothScrollTo(getAllowedHorizontalScrollLength(), 0);
+ break;
+ }
+ updateTouchInterceptors();
+ }
+
+ /**
+ * Returns the desired page we should scroll to based on the current X scroll position and the
+ * current page.
+ */
+ private int getDesiredPage() {
+ switch (mCurrentPage) {
+ case ABOUT_PAGE:
+ // If the user is on the "about" page, and the scroll position exceeds the lower
+ // threshold, then we should switch to the "updates" page.
+ return (mLastScrollPosition > getLowerThreshold()) ? UPDATES_PAGE : ABOUT_PAGE;
+ case UPDATES_PAGE:
+ // If the user is on the "updates" page, and the scroll position goes below the
+ // upper threshold, then we should switch to the "about" page.
+ return (mLastScrollPosition < getUpperThreshold()) ? ABOUT_PAGE : UPDATES_PAGE;
+ }
+ throw new IllegalStateException("Invalid current page " + mCurrentPage);
+ }
+
+ /**
+ * Returns the number of pixels that this view can be scrolled horizontally.
+ */
+ private int getAllowedHorizontalScrollLength() {
+ if (mAllowedHorizontalScrollLength == Integer.MIN_VALUE) {
+ computeThresholds();
+ }
+ return mAllowedHorizontalScrollLength;
+ }
+
+ /**
+ * Returns the minimum X scroll position that must be surpassed (if the user is on the "about"
+ * page of the contact card), in order for this view to automatically snap to the "updates"
+ * page.
+ */
+ private int getLowerThreshold() {
+ if (mLowerThreshold == Integer.MIN_VALUE) {
+ computeThresholds();
+ }
+ return mLowerThreshold;
+ }
+
+ /**
+ * Returns the maximum X scroll position (if the user is on the "updates" page of the contact
+ * card), below which this view will automatically snap to the "about" page.
+ */
+ private int getUpperThreshold() {
+ if (mLowerThreshold == Integer.MIN_VALUE) {
+ computeThresholds();
+ }
+ return mUpperThreshold;
+ }
+
+ // TODO: Move this to a Fragment override method (i.e. onActivityCreated or some method where
+ // we can be sure the width of the views are non-zero) instead of doing it on the fly when the
+ // values are requested for the first time.
+ private void computeThresholds() {
+ int screenWidth = getWidth();
+ int fragmentWidth = findViewById(R.id.about_fragment).getWidth();
+ mAllowedHorizontalScrollLength = (2 * fragmentWidth) - screenWidth;
+ mLowerThreshold = (screenWidth - fragmentWidth) / 2;
+ mUpperThreshold = mAllowedHorizontalScrollLength - mLowerThreshold;
+ }
+
+ @Override
+ public boolean onTouch(View v, MotionEvent event) {
+ if (event.getAction() == MotionEvent.ACTION_UP) {
+ mCurrentPage = getDesiredPage();
+ snapToEdge();
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/com/android/contacts/detail/ContactDetailTabCarousel.java b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
index dc3e126..a12106f 100644
--- a/src/com/android/contacts/detail/ContactDetailTabCarousel.java
+++ b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
@@ -19,12 +19,10 @@
import com.android.contacts.ContactLoader;
import com.android.contacts.ContactSaveService;
import com.android.contacts.R;
-import com.android.contacts.activities.ContactDetailActivity;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
-import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
diff --git a/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java b/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java
index 02678de..0c4dc4f 100644
--- a/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java
@@ -23,19 +23,67 @@
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
+import android.view.View.OnClickListener;
import android.view.ViewGroup;
-public class ContactDetailUpdatesFragment extends Fragment implements FragmentKeyListener {
+public class ContactDetailUpdatesFragment extends Fragment
+ implements FragmentKeyListener, FragmentOverlay {
private static final String TAG = "ContactDetailUpdatesFragment";
+ /**
+ * This optional view adds an alpha layer over the entire fragment.
+ */
+ private View mAlphaLayer;
+
+ /**
+ * This optional view adds a layer over the entire fragment so that when visible, it intercepts
+ * all touch events on the fragment.
+ */
+ private View mTouchInterceptLayer;
+
public ContactDetailUpdatesFragment() {
// Explicit constructor for inflation
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
- return inflater.inflate(R.layout.contact_detail_updates_fragment, container, false);
+ View rootView = inflater.inflate(R.layout.contact_detail_updates_fragment, container,
+ false);
+
+ mAlphaLayer = rootView.findViewById(R.id.alpha_overlay);
+ mTouchInterceptLayer = rootView.findViewById(R.id.touch_intercept_overlay);
+
+ return rootView;
+ }
+
+ @Override
+ public void setAlphaLayerValue(float alpha) {
+ if (mAlphaLayer != null) {
+ mAlphaLayer.setAlpha(alpha);
+ }
+ }
+
+ @Override
+ public void enableAlphaLayer() {
+ if (mAlphaLayer != null) {
+ mAlphaLayer.setVisibility(View.VISIBLE);
+ }
+ }
+
+ @Override
+ public void enableTouchInterceptor(OnClickListener clickListener) {
+ if (mTouchInterceptLayer != null) {
+ mTouchInterceptLayer.setVisibility(View.VISIBLE);
+ mTouchInterceptLayer.setOnClickListener(clickListener);
+ }
+ }
+
+ @Override
+ public void disableTouchInterceptor() {
+ if (mTouchInterceptLayer != null) {
+ mTouchInterceptLayer.setVisibility(View.GONE);
+ }
}
@Override
diff --git a/src/com/android/contacts/detail/FragmentOverlay.java b/src/com/android/contacts/detail/FragmentOverlay.java
new file mode 100644
index 0000000..6ef0846
--- /dev/null
+++ b/src/com/android/contacts/detail/FragmentOverlay.java
@@ -0,0 +1,49 @@
+/*
+ * 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.detail;
+
+import android.view.View.OnClickListener;
+
+/**
+ * This is implemented by {@link Fragment}s that contain an alpha layer and touch interceptor layer.
+ * The alpha layer covers the entire fragment and has an alpha value which makes the fragment
+ * contents appear "dimmed" out. The touch interceptor layer covers the entire fragment so that
+ * when visible, it intercepts all touch events on the {@link Fragment}.
+ */
+public interface FragmentOverlay {
+
+ /**
+ * Sets the alpha value on the alpha layer (if there is one).
+ */
+ public void setAlphaLayerValue(float alpha);
+
+ /**
+ * Makes the alpha layer on this fragment visible (if there is one).
+ */
+ public void enableAlphaLayer();
+
+ /**
+ * Makes the touch intercept layer on this fragment visible (if there is one). Also adds a click
+ * listener which is called when there is a touch event on the layer.
+ */
+ public void enableTouchInterceptor(OnClickListener clickListener);
+
+ /**
+ * Makes the touch intercept layer on this fragment gone (if there is one).
+ */
+ public void disableTouchInterceptor();
+}
diff --git a/src/com/android/contacts/widget/InterpolatingLayout.java b/src/com/android/contacts/widget/InterpolatingLayout.java
index fc67ef5..78785b9 100644
--- a/src/com/android/contacts/widget/InterpolatingLayout.java
+++ b/src/com/android/contacts/widget/InterpolatingLayout.java
@@ -283,6 +283,10 @@
for (int i = 0; i < count; i++) {
View child = getChildAt(i);
+ if (child.getVisibility() == View.GONE) {
+ continue;
+ }
+
LayoutParams params = (LayoutParams) child.getLayoutParams();
int gravity = params.gravity;
if (gravity == -1) {