Change contact detail on 7" to fragment carousel
Contact details in 7" landscape uses the fragment
carousel to show details with updates. The layout
of the contact details fragment follows the 10"
landscape contact details fragment layout. Dimming
of the detail or updates panel in the fragment
carousel has been disabled, and to be consistent,
this dimming is also disabled on the phone landscape
layout.
Also, this changes fixes the bug with the overscroll
indicators in the contact details pane.
Bug: 6398940
Bug: 6378743
Change-Id: Ie93ab73a9ebad8b66f5bc7d75222f5550ed1b005
diff --git a/res/layout-sw580dp-w940dp/contact_detail_container.xml b/res/layout-sw580dp-w940dp/contact_detail_container.xml
new file mode 100644
index 0000000..e653d9d
--- /dev/null
+++ b/res/layout-sw580dp-w940dp/contact_detail_container.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <com.android.contacts.detail.ContactDetailFragmentCarousel
+ android:id="@+id/fragment_carousel"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_marginLeft="16dip"/>
+
+</FrameLayout>
diff --git a/res/layout-sw580dp-w940dp/contact_detail_fragment.xml b/res/layout-sw580dp-w940dp/contact_detail_fragment.xml
new file mode 100644
index 0000000..cf89727
--- /dev/null
+++ b/res/layout-sw580dp-w940dp/contact_detail_fragment.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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/contact_detail"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/background_primary"
+ android:paddingRight="16dip">
+
+ <!-- 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_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:baselineAligned="false">
+
+ <include android:id="@+id/static_photo_container"
+ layout="@layout/photo_selector_view"
+ android:layout_width="@dimen/detail_contact_photo_size"
+ android:layout_height="@dimen/detail_contact_photo_size"
+ android:layout_marginTop="@dimen/detail_contact_photo_margin"
+ android:layout_marginRight="@dimen/detail_contact_photo_margin" />
+
+ <ListView android:id="@android:id/list"
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:paddingTop="16dip"
+ android:clipToPadding="false"
+ android:fadingEdge="none"
+ 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="center"
+ android:layout_marginTop="10dip"
+ android:layout_marginBottom="10dip" />
+</LinearLayout>
diff --git a/res/layout-sw580dp-w940dp/contact_detail_updates_fragment.xml b/res/layout-sw580dp-w940dp/contact_detail_updates_fragment.xml
new file mode 100644
index 0000000..3bcce3f
--- /dev/null
+++ b/res/layout-sw580dp-w940dp/contact_detail_updates_fragment.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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.
+-->
+
+<ListView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@color/background_social_updates"
+ android:fadingEdge="none"
+ android:divider="@null"
+ android:paddingTop="@dimen/contact_detail_list_top_padding"
+ android:paddingLeft="16dip"
+ android:paddingRight="16dip"
+ android:clipToPadding="false"/>
diff --git a/res/layout-sw580dp-w940dp/detail_header_contact_with_updates.xml b/res/layout-sw580dp-w940dp/detail_header_contact_with_updates.xml
new file mode 100644
index 0000000..32eecc9
--- /dev/null
+++ b/res/layout-sw580dp-w940dp/detail_header_contact_with_updates.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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:paddingBottom="8dip"
+ android:orientation="horizontal">
+
+ <include layout="@layout/photo_selector_view"
+ android:layout_width="@dimen/detail_contact_photo_size"
+ android:layout_height="@dimen/detail_contact_photo_size" />
+
+ <LinearLayout
+ android:layout_width="0dip"
+ android:layout_height="match_parent"
+ android:layout_weight="1"
+ android:orientation="vertical"
+ android:paddingLeft="16dip"
+ android:paddingRight="4dip">
+
+ <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"
+ android:textColor="?android:attr/textColorSecondary" />
+
+ </LinearLayout>
+
+ <include
+ layout="@layout/favorites_star" />
+
+</LinearLayout>
diff --git a/res/layout-sw580dp-w940dp/detail_header_contact_without_updates.xml b/res/layout-sw580dp-w940dp/detail_header_contact_without_updates.xml
new file mode 100644
index 0000000..57a2820
--- /dev/null
+++ b/res/layout-sw580dp-w940dp/detail_header_contact_without_updates.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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:paddingLeft="8dip"
+ android:paddingBottom="16dip"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingRight="16dip">
+
+ <TextView
+ android:id="@+id/name"
+ android:layout_width="0dip"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:textSize="@dimen/detail_header_name_text_size"
+ android:paddingRight="16dip" />
+
+ <include
+ layout="@layout/favorites_star" />
+
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/company"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:textColor="?android:attr/textColorSecondary" />
+
+</LinearLayout>
diff --git a/res/layout-sw580dp-w940dp/people_activity.xml b/res/layout-sw580dp-w940dp/people_activity.xml
index 44e740e..3a86842 100644
--- a/res/layout-sw580dp-w940dp/people_activity.xml
+++ b/res/layout-sw580dp-w940dp/people_activity.xml
@@ -67,10 +67,7 @@
android:id="@+id/contact_detail_container"
layout="@layout/contact_detail_container"
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginLeft="16dip"
- android:layout_marginTop="16dip"
- android:layout_marginRight="16dip" />
+ android:layout_height="match_parent"/>
<!-- This invisible worker fragment loads the contact's details -->
<fragment
diff --git a/res/layout-sw580dp-w940dp/updates_header_contact.xml b/res/layout-sw580dp-w940dp/updates_header_contact.xml
new file mode 100644
index 0000000..1ffdcaa
--- /dev/null
+++ b/res/layout-sw580dp-w940dp/updates_header_contact.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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 updates list.
+-->
+<FrameLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:focusable="false">
+
+ <TextView
+ style="?android:attr/listSeparatorTextViewStyle"
+ android:layout_height="32dip"
+ android:paddingLeft="8dip"
+ android:paddingRight="8dip"
+ android:background="@drawable/list_section_divider_holo_custom"
+ android:text="@string/recent_updates"
+ android:textColor="@color/people_app_theme_color"
+ android:textAllCaps="true"
+ android:singleLine="true"
+ android:ellipsize="end" />
+
+</FrameLayout>
diff --git a/res/layout-sw680dp/contact_detail_container.xml b/res/layout-sw680dp/contact_detail_container.xml
new file mode 100644
index 0000000..dfbd0d0
--- /dev/null
+++ b/res/layout-sw680dp/contact_detail_container.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/pager"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+
+ <include
+ android:id="@+id/tab_carousel"
+ layout="@layout/contact_detail_tab_carousel"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:visibility="gone"/>
+
+</RelativeLayout>
diff --git a/res/layout-sw680dp/contact_detail_fragment.xml b/res/layout-sw680dp/contact_detail_fragment.xml
new file mode 100644
index 0000000..3e4d255
--- /dev/null
+++ b/res/layout-sw680dp/contact_detail_fragment.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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/contact_detail"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <!-- Placeholder for empty list -->
+ <include
+ android:id="@android:id/empty"
+ layout="@layout/contact_detail_empty"
+ android:visibility="gone" />
+
+ <!-- Real list -->
+ <ListView android:id="@android:id/list"
+ android:layout_weight="1"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:fadingEdge="none"
+ android:cacheColorHint="#00000000"
+ android:divider="@null"
+ />
+
+ <!-- "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="center"
+ android:layout_marginTop="10dip"
+ android:layout_marginBottom="10dip" />
+</LinearLayout>
diff --git a/res/layout-sw680dp/contact_detail_updates_fragment.xml b/res/layout-sw680dp/contact_detail_updates_fragment.xml
new file mode 100644
index 0000000..03a2e41
--- /dev/null
+++ b/res/layout-sw680dp/contact_detail_updates_fragment.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2012 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_updates_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ListView android:id="@android:id/list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:fadingEdge="none"
+ android:divider="@null"/>
+
+</FrameLayout>
diff --git a/res/layout-w470dp/contact_detail_fragment.xml b/res/layout-w470dp/contact_detail_fragment.xml
index b5c4c94..86692d8 100644
--- a/res/layout-w470dp/contact_detail_fragment.xml
+++ b/res/layout-w470dp/contact_detail_fragment.xml
@@ -36,12 +36,13 @@
android:layout_width="match_parent"
android:layout_above="@id/contact_quick_fix"
android:layout_height="match_parent"
- android:baselineAligned="false" >
+ android:baselineAligned="false"
+ android:background="@android:color/white">
<include android:id="@+id/static_photo_container"
layout="@layout/photo_selector_view"
- android:layout_width="128dip"
- android:layout_height="128dip"
+ 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_marginTop="@dimen/detail_contact_photo_margin" />
diff --git a/res/layout-w470dp/contact_detail_updates_fragment.xml b/res/layout-w470dp/contact_detail_updates_fragment.xml
index 338a986..801f2bb 100644
--- a/res/layout-w470dp/contact_detail_updates_fragment.xml
+++ b/res/layout-w470dp/contact_detail_updates_fragment.xml
@@ -17,12 +17,14 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/contact_detail_updates_fragment"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:background="@color/background_social_updates">
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fadingEdge="none"
- android:divider="@null"/>
+ android:divider="@null"
+ android:background="@android:color/transparent"/>
</FrameLayout>
diff --git a/res/values-sw580dp-w940dp/dimens.xml b/res/values-sw580dp-w940dp/dimens.xml
index 4053a98..99f749c 100644
--- a/res/values-sw580dp-w940dp/dimens.xml
+++ b/res/values-sw580dp-w940dp/dimens.xml
@@ -17,4 +17,6 @@
<dimen name="group_editor_side_padding">64dip</dimen>
<dimen name="quick_contact_photo_container_height">180dip</dimen>
<dimen name="list_visible_scrollbar_padding">32dip</dimen>
+ <dimen name="detail_contact_photo_size">192dip</dimen>
+ <dimen name="detail_contact_photo_margin">16dip</dimen>
</resources>
diff --git a/res/values-sw680dp-w1000dp/dimens.xml b/res/values-sw680dp-w1000dp/dimens.xml
index 661401a..6a2d1cc 100644
--- a/res/values-sw680dp-w1000dp/dimens.xml
+++ b/res/values-sw680dp-w1000dp/dimens.xml
@@ -16,8 +16,8 @@
<resources>
<dimen name="group_detail_border_padding">32dip</dimen>
<dimen name="group_editor_side_padding">64dip</dimen>
- <dimen name="detail_contact_photo_margin">16dip</dimen>
<dimen name="contact_detail_list_top_padding">32dip</dimen>
<dimen name="contact_tile_list_padding_top">32dip</dimen>
<dimen name="list_visible_scrollbar_padding">48dip</dimen>
+ <dimen name="detail_contact_photo_size">256dip</dimen>
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index cbfccd5..c53e03f 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -80,7 +80,7 @@
<dimen name="detail_contact_photo_margin">8dip</dimen>
<!-- Width and height of the contact photo on the contact detail page -->
- <dimen name="detail_contact_photo_size">256dip</dimen>
+ <dimen name="detail_contact_photo_size">128dip</dimen>
<!-- Left and right padding for a contact detail item -->
<dimen name="detail_item_icon_margin">8dip</dimen>