Merge "Catch ActivityNotFoundExceptions"
diff --git a/res/layout-land/contact_detail_container.xml b/res/layout-land/contact_detail_container.xml
deleted file mode 100644
index fc401b7..0000000
--- a/res/layout-land/contact_detail_container.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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: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"/>
-
-</FrameLayout>
\ No newline at end of file
diff --git a/res/layout-land/contact_detail_updates_fragment.xml b/res/layout-land/contact_detail_updates_fragment.xml
deleted file mode 100644
index 801f2bb..0000000
--- a/res/layout-land/contact_detail_updates_fragment.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?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_updates_fragment"
- android:layout_width="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:background="@android:color/transparent"/>
-
-</FrameLayout>
diff --git a/res/layout-land/updates_header_contact.xml b/res/layout-land/updates_header_contact.xml
deleted file mode 100644
index 844188e..0000000
--- a/res/layout-land/updates_header_contact.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?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 updates list.
--->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="32dip"
- android:paddingLeft="16dip"
- android:paddingRight="16dip"
- android:paddingStart="16dip"
- android:paddingEnd="16dip"
- android:focusable="false">
-
- <TextView
- style="?android:attr/listSeparatorTextViewStyle"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
- android:paddingStart="8dip"
- android:paddingEnd="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-sw600dp-land/contact_detail_container.xml b/res/layout-sw600dp-land/contact_detail_container.xml
deleted file mode 100644
index 3597d9f..0000000
--- a/res/layout-sw600dp-land/contact_detail_container.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?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"
- android:layout_marginStart="16dip"/>
-
-</FrameLayout>
diff --git a/res/layout-sw600dp-land/detail_header_contact_with_updates.xml b/res/layout-sw600dp-land/detail_header_contact_with_updates.xml
deleted file mode 100644
index 6476300..0000000
--- a/res/layout-sw600dp-land/detail_header_contact_with_updates.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<?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"
- android:paddingStart="16dip"
- android:paddingEnd="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-sw600dp-land/updates_header_contact.xml b/res/layout-sw600dp-land/updates_header_contact.xml
deleted file mode 100644
index eb0eee7..0000000
--- a/res/layout-sw600dp-land/updates_header_contact.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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:paddingStart="8dip"
- android:paddingEnd="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-sw600dp/contact_detail_container.xml b/res/layout-sw600dp/contact_detail_container.xml
deleted file mode 100644
index d7accaf..0000000
--- a/res/layout-sw600dp/contact_detail_container.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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: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_alignParentStart="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_alignParentStart="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone"/>
-
-</RelativeLayout>
\ No newline at end of file
diff --git a/res/layout-sw600dp/contact_detail_updates_fragment.xml b/res/layout-sw600dp/contact_detail_updates_fragment.xml
deleted file mode 100644
index 537d68f..0000000
--- a/res/layout-sw600dp/contact_detail_updates_fragment.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?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_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"
- android:scrollbarStyle="outsideOverlay"
- android:paddingRight="12dip"
- android:paddingEnd="12dip" />
-
-</FrameLayout>
diff --git a/res/layout-sw600dp/detail_header_contact_with_updates.xml b/res/layout-sw600dp/detail_header_contact_with_updates.xml
deleted file mode 100644
index 06b82dd..0000000
--- a/res/layout-sw600dp/detail_header_contact_with_updates.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?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"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:layout_marginTop="30dip"
- android:paddingBottom="16dip">
-
- <!-- Add a first item that gives us enough space to show the carousel -->
- <view
- class="com.android.contacts.common.widget.ProportionalLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- ex:ratio="0.6667"
- ex:direction="widthToHeight">
-
- <!-- Put a dummy view here because the ProportionalLayout requires one -->
- <View
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
-
- </view>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:paddingTop="8dip"
- android:paddingEnd="8dip" >
-
- <TextView
- android:id="@+id/name"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_weight="1"
- android:paddingStart="8dip"
- android:paddingEnd="24dip"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:textSize="@dimen/detail_header_name_text_size" />
-
- <include
- layout="@layout/favorites_star" />
-
- </LinearLayout>
-
- <TextView
- android:id="@+id/company"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingStart="8dip"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="?android:attr/textColorSecondary" />
-
-</LinearLayout>
diff --git a/res/layout-sw600dp/updates_header_contact.xml b/res/layout-sw600dp/updates_header_contact.xml
deleted file mode 100644
index e95f1dd..0000000
--- a/res/layout-sw600dp/updates_header_contact.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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 updates list.
--->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <!-- This blank view pushes the other content down because of the tab carousel -->
- <view
- class="com.android.contacts.common.widget.ProportionalLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="8dip"
- ex:ratio="0.6667"
- ex:direction="widthToHeight">
-
- <!-- Put a dummy view here because the ProportionalLayout requires one -->
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
- </view>
-
- <!-- "Recent updates" header text -->
- <TextView
- style="?android:attr/listSeparatorTextViewStyle"
- android:layout_height="32dip"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
- android:paddingStart="8dip"
- android:paddingEnd="8dip"
- android:background="@drawable/list_section_divider_holo_custom"
- android:text="@string/recent"
- android:textColor="@color/people_app_theme_color"
- android:textAllCaps="true"
- android:singleLine="true"
- android:ellipsize="end" />
-
-</LinearLayout>
diff --git a/res/layout-sw720dp-land/contact_detail_container.xml b/res/layout-sw720dp-land/contact_detail_container.xml
deleted file mode 100644
index 8180e92..0000000
--- a/res/layout-sw720dp-land/contact_detail_container.xml
+++ /dev/null
@@ -1,60 +0,0 @@
-<?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.
--->
-
-<!--
- Two-column layout for a contact with social updates. If the contact does not
- have social updates, then the second fragment container will just be hidden.
--->
-
-<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"
- android:baselineAligned="false">
-
- <!--
- Container for the "About" fragment on the contact card for a contact
- with social updates. This view ID must match with a view ID in the layout
- that is used after an orientation change.
- -->
- <FrameLayout
- android:id="@+id/about_fragment_container"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="3" />
-
- <!-- Vertical divider -->
- <View
- android:layout_width="2dip"
- android:layout_height="match_parent"
- android:background="?android:attr/listDivider"
- />
-
- <!--
- Container for the "Updates" fragment on the contact card for a contact
- with social updates. This view ID must match with a view ID in the layout
- that is used after an orientation change.
- -->
- <FrameLayout
- android:id="@+id/updates_fragment_container"
- android:layout_width="0dip"
- android:layout_weight="2"
- android:layout_height="match_parent"
- android:visibility="gone" />
-
-</LinearLayout>
diff --git a/res/layout-sw720dp-land/detail_header_contact_with_updates.xml b/res/layout-sw720dp-land/detail_header_contact_with_updates.xml
deleted file mode 100644
index 268b51a..0000000
--- a/res/layout-sw720dp-land/detail_header_contact_with_updates.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?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: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:paddingStart="16dip"
- android:paddingEnd="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>
\ No newline at end of file
diff --git a/res/layout-sw720dp-land/updates_header_contact.xml b/res/layout-sw720dp-land/updates_header_contact.xml
deleted file mode 100644
index 8173f81..0000000
--- a/res/layout-sw720dp-land/updates_header_contact.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?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 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:paddingStart="8dip"
- android:paddingEnd="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/carousel_about_tab.xml b/res/layout/carousel_about_tab.xml
deleted file mode 100644
index 8026f37..0000000
--- a/res/layout/carousel_about_tab.xml
+++ /dev/null
@@ -1,80 +0,0 @@
-<?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.
--->
-
-<view
- xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.contacts.detail.CarouselTab"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1">
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <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"
- android:layout_alignParentStart="true"/>
-
- <View android:id="@+id/photo_overlay"
- android:background="?android:attr/selectableItemBackground"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"/>
-
- <!-- Transparent view to overlay on the contact's photo
- (to allow white text to appear over a white photo). -->
- <View android:id="@+id/label_background"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentBottom="true"
- android:background="#7F000000" />
-
- <View
- android:id="@+id/alpha_overlay"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:layout_marginBottom="@dimen/detail_tab_carousel_tab_label_height"/>
-
- <TextView
- android:id="@+id/label"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentBottom="true"
- android:paddingLeft="@dimen/detail_tab_carousel_tab_label_indent"
- android:paddingStart="@dimen/detail_tab_carousel_tab_label_indent"
- android:singleLine="true"
- android:gravity="left|center_vertical"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/detail_tab_carousel_tab_label_color"
- style="@android:style/Widget.Holo.ActionBar.TabView" />
-
- </RelativeLayout>
-
-</view>
diff --git a/res/layout/carousel_updates_tab.xml b/res/layout/carousel_updates_tab.xml
deleted file mode 100644
index 0bd5cbd..0000000
--- a/res/layout/carousel_updates_tab.xml
+++ /dev/null
@@ -1,98 +0,0 @@
-<?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.
--->
-
-<!--
- TODO: Collapse carousel_about_tab with carousel_updates_tab into 1 XML that
- handles all cases when updates fragment is more finalized.
--->
-<view
- xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.contacts.detail.CarouselTab"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:background="@drawable/bg_people_updates_holo">
-
- <RelativeLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent" >
-
- <ImageView android:id="@+id/status_photo"
- android:scaleType="centerCrop"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:visibility="gone" />
-
- <!-- Transparent view to overlay on the update photo
- (to allow white text to appear over a white photo). -->
- <View android:id="@+id/label_background"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentBottom="true"
- android:layout_above="@id/status_photo"
- android:background="#7F000000" />
-
- <TextView android:id="@+id/status"
- android:layout_width="wrap_content"
- android:layout_height="match_parent"
- android:layout_alignParentTop="true"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_above="@id/label"
- android:gravity="center_vertical"
- android:paddingLeft="@dimen/detail_update_tab_side_padding"
- android:paddingRight="@dimen/detail_update_tab_side_padding"
- android:paddingStart="@dimen/detail_update_tab_side_padding"
- android:paddingEnd="@dimen/detail_update_tab_side_padding"
- android:textAppearance="?android:attr/textAppearanceLarge"
- android:textColor="@color/detail_update_tab_text_color"
- android:textStyle="bold"
- android:maxLines="@integer/updates_tab_snippet_max_lines"
- android:ellipsize="end" />
-
- <View
- android:id="@+id/alpha_overlay"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:layout_marginBottom="@dimen/detail_tab_carousel_tab_label_height"/>
-
- <TextView
- android:id="@+id/label"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_tab_carousel_tab_label_height"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentBottom="true"
- android:layout_above="@id/status_photo"
- android:paddingLeft="@dimen/detail_tab_carousel_tab_label_indent"
- android:paddingStart="@dimen/detail_tab_carousel_tab_label_indent"
- android:singleLine="true"
- android:gravity="start|center_vertical"
- android:textAppearance="?android:attr/textAppearanceMedium"
- android:textColor="@color/detail_tab_carousel_tab_label_color"
- style="@android:style/Widget.Holo.ActionBar.TabView" />
-
- </RelativeLayout>
-
-</view>
diff --git a/res/layout/contact_detail_about_fragment_container.xml b/res/layout/contact_detail_about_fragment_container.xml
deleted file mode 100644
index 6fc9fe2..0000000
--- a/res/layout/contact_detail_about_fragment_container.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?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.
--->
-
-<!--
- Container for the "About" page fragment on the contact card for a contact with social updates.
- This view ID must match with a view ID in the layout that is used after an orientation change.
--->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/about_fragment_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
\ No newline at end of file
diff --git a/res/layout/contact_detail_container.xml b/res/layout/contact_detail_container.xml
index f6b3438..910d684 100644
--- a/res/layout/contact_detail_container.xml
+++ b/res/layout/contact_detail_container.xml
@@ -14,35 +14,12 @@
limitations under the License.
-->
-<!--
- Layout for the contact card page. If the contact has social updates, then
- the ViewPager and ContactDetailTabCarousel are shown together. If there
- aren't any social updates, then just the ContactDetailFragment will be
- shown. We include all 3 views even though they are never shown
- simultaneously because this layout is reused but set with different data
- each time (i.e. on a tablet).
--->
-
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<!-- Layout for the contact card page. -->
+<FrameLayout 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_alignParentStart="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_alignParentStart="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:visibility="gone"/>
-
-</RelativeLayout>
\ No newline at end of file
+ <fragment android:name="com.android.contacts.detail.ContactDetailFragment"
+ android:id="@+id/contact_detail_about_fragment"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"/>
+</FrameLayout>
\ No newline at end of file
diff --git a/res/layout/contact_detail_fragment_carousel.xml b/res/layout/contact_detail_fragment_carousel.xml
deleted file mode 100644
index 0695511..0000000
--- a/res/layout/contact_detail_fragment_carousel.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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"
- android:baselineAligned="false">
-
- <!--
- Container for the "About" page fragment on the contact card for a contact
- with social updates. This view ID must match with a view ID in the layout
- that is used after an orientation change.
- -->
- <view
- class="com.android.contacts.widget.FrameLayoutWithOverlay"
- android:id="@+id/about_fragment_container"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:focusable="true"
- android:focusableInTouchMode="true" />
-
- <!--
- Container for the "Updates" page fragment on the contact card for a contact
- with social updates. This view ID must match with a view ID in the layout
- that is used after an orientation change.
- -->
- <view
- class="com.android.contacts.widget.FrameLayoutWithOverlay"
- android:id="@+id/updates_fragment_container"
- android:layout_width="0dip"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:visibility="gone" />
-
-</LinearLayout>
\ No newline at end of file
diff --git a/res/layout/contact_detail_tab_carousel.xml b/res/layout/contact_detail_tab_carousel.xml
deleted file mode 100644
index 711a6c3..0000000
--- a/res/layout/contact_detail_tab_carousel.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?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.
--->
-
-<view
- xmlns:android="http://schemas.android.com/apk/res/android"
- class="com.android.contacts.detail.ContactDetailTabCarousel"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:scrollbars="none"
- android:fadingEdge="none">
-
- <LinearLayout
- android:id="@+id/tab_and_shadow_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <LinearLayout
- android:id="@+id/tab_container"
- android:layout_width="match_parent"
- android:layout_height="0dip"
- android:layout_weight="1"
- android:orientation="horizontal"
- android:baselineAligned="false">
-
- <!-- "About" tab -->
- <include
- android:id="@+id/tab_about"
- layout="@layout/carousel_about_tab" />
-
- <!-- Vertical divider -->
- <View
- android:id="@+id/tab_divider"
- android:layout_width="1dip"
- android:layout_height="match_parent"
- android:background="@android:color/white"/>
-
- <!-- "Updates" tab -->
- <include
- android:id="@+id/tab_update"
- layout="@layout/carousel_updates_tab" />
-
- </LinearLayout>
-
- <!--
- Shadow below the carousel. The ContactDetailTabCarousel increases its height to
- account for this shadow, and the class assumes the height of this shadow to be
- @dimen/detail_contact_photo_shadow_height.
- -->
- <View
- android:id="@+id/shadow"
- android:layout_width="match_parent"
- android:layout_height="@dimen/detail_contact_photo_shadow_height"
- android:background="?android:attr/windowContentOverlay"/>
-
- </LinearLayout>
-
-</view>
diff --git a/res/layout/detail_header_contact_with_updates.xml b/res/layout/detail_header_contact_with_updates.xml
deleted file mode 100644
index dc4cf8b..0000000
--- a/res/layout/detail_header_contact_with_updates.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?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 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.
- The FrameLayout is used to apply additional padding which is needed for the shadow
--->
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
- <view
- class="com.android.contacts.common.widget.ProportionalLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/detail_contact_photo_shadow_height"
- ex:ratio="0.5"
- ex:direction="widthToHeight">
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
- </view>
-</FrameLayout>
diff --git a/res/layout/social_widget.xml b/res/layout/social_widget.xml
deleted file mode 100644
index 1267bd9..0000000
--- a/res/layout/social_widget.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?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.
--->
-
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="#00000000">
- <LinearLayout
- android:id="@+id/widget_container"
- android:orientation="horizontal"
- android:layout_width="match_parent"
- android:layout_height="match_parent">
- <FrameLayout
- android:layout_width="70dp"
- android:layout_height="70dp"
- android:layout_gravity="center_vertical">
- <ImageView
- android:id="@+id/image"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- <ImageButton
- android:id="@+id/border"
- android:background="@drawable/frame_thumbnail_contact_widget_holo"
- android:layout_width="match_parent"
- android:layout_height="match_parent" />
- </FrameLayout>
- <RelativeLayout
- android:id="@+id/name_and_snippet_container"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_weight="1"
- android:paddingLeft="43dp"
- android:paddingRight="4dp"
- android:paddingStart="43dp"
- android:paddingEnd="4dp"
- android:paddingTop="4dp"
- android:paddingBottom="4dp"
- android:background="@drawable/bg_status_contact_widget">
- <TextView
- android:id="@+id/name_and_snippet"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_alignParentStart="true"
- android:layout_alignParentTop="true"
- android:maxLines="3"
- android:lineSpacingExtra="2sp"
- android:textColor="#FFFFFFFF"
- android:textSize="@dimen/widget_text_size_snippet" />
- <TextView
- android:id="@+id/name"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center"
- android:textColor="#FFFFFFFF"
- android:textSize="@dimen/widget_text_size_name" />
- </RelativeLayout>
- </LinearLayout>
-</FrameLayout>
diff --git a/res/layout/stream_item_container.xml b/res/layout/stream_item_container.xml
deleted file mode 100644
index 33840b6..0000000
--- a/res/layout/stream_item_container.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-<?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="wrap_content"
- android:orientation="vertical"
- android:paddingLeft="@dimen/detail_update_section_side_padding"
- android:paddingRight="@dimen/detail_update_section_side_padding"
- android:paddingStart="@dimen/detail_update_section_side_padding"
- android:paddingEnd="@dimen/detail_update_section_side_padding">
-
- <!-- Clickable area -->
- <LinearLayout
- android:id="@+id/stream_item_content"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="@dimen/detail_update_section_item_horizontal_padding"
- android:paddingRight="@dimen/detail_update_section_item_horizontal_padding"
- android:paddingStart="@dimen/detail_update_section_item_horizontal_padding"
- android:paddingEnd="@dimen/detail_update_section_item_horizontal_padding"
- android:paddingTop="@dimen/detail_update_section_item_vertical_padding"
- android:paddingBottom="@dimen/detail_update_section_item_vertical_padding"
- android:background="?android:attr/selectableItemBackground"
- android:orientation="vertical"
- >
-
- <!-- Images -->
- <LinearLayout
- android:id="@+id/stream_item_image_rows"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingBottom="@dimen/detail_update_section_between_items_vertical_padding"
- android:layout_gravity="center_vertical"
- android:orientation="vertical"
- >
- </LinearLayout>
-
- <!-- Text -->
- <TextView android:id="@+id/stream_item_html"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:textSize="16sp"
- android:textColor="?android:attr/textColorPrimary"
- android:textAlignment="viewStart" />
- <!--
- Attribution (e.g. timestamp) and comments (e.g. +1, like) should align horizontally.
- Can't merge this with the parent list view.
- -->
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- >
- <TextView android:id="@+id/stream_item_attribution"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:ellipsize="end"
- android:maxLines="1" />
- <TextView android:id="@+id/stream_item_comments"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/detail_update_section_attribution_comments_padding"
- android:layout_marginStart="@dimen/detail_update_section_attribution_comments_padding"
- android:textAppearance="?android:attr/textAppearanceSmall"
- android:textColor="?android:attr/textColorSecondary"
- android:maxLines="1"/>
- </LinearLayout>
- </LinearLayout>
-
- <View
- android:id="@+id/horizontal_divider"
- android:layout_width="match_parent"
- android:layout_height="1px"
- android:background="?android:attr/dividerHorizontal"
- android:layout_gravity="bottom" />
-
-</LinearLayout>
diff --git a/res/layout/stream_item_photo.xml b/res/layout/stream_item_photo.xml
deleted file mode 100644
index 9e27d2a..0000000
--- a/res/layout/stream_item_photo.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?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">
- <com.android.contacts.common.widget.LayoutSuppressingImageView
- android:id="@+id/image"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
- <View
- android:id="@+id/push_layer"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="?android:attr/selectableItemBackground"/>
-</FrameLayout>
diff --git a/res/layout/stream_item_row_images.xml b/res/layout/stream_item_row_images.xml
deleted file mode 100644
index a3f1325..0000000
--- a/res/layout/stream_item_row_images.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?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-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="@dimen/detail_update_section_between_items_padding">
-
- <view
- class="com.android.contacts.common.widget.ProportionalLayout"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_marginRight="@dimen/detail_update_section_between_items_padding"
- android:layout_marginEnd="@dimen/detail_update_section_between_items_padding"
- android:layout_weight="1"
- ex:ratio="1"
- ex:direction="widthToHeight">
- <include
- android:id="@+id/stream_item_first_image"
- layout="@layout/stream_item_photo"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
- </view>
-
- <view
- android:id="@+id/second_image_container"
- class="com.android.contacts.common.widget.ProportionalLayout"
- android:layout_width="0dip"
- android:layout_height="wrap_content"
- android:layout_marginLeft="@dimen/detail_update_section_between_items_padding"
- android:layout_marginStart="@dimen/detail_update_section_between_items_padding"
- android:layout_weight="1"
- ex:ratio="1"
- ex:direction="widthToHeight">
- <include
- android:id="@+id/stream_item_second_image"
- layout="@layout/stream_item_photo"
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
- </view>
-
-</LinearLayout>
diff --git a/res/layout/updates_header_contact.xml b/res/layout/updates_header_contact.xml
deleted file mode 100644
index 66cdac4..0000000
--- a/res/layout/updates_header_contact.xml
+++ /dev/null
@@ -1,68 +0,0 @@
-<?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 updates list.
--->
-<LinearLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:ex="http://schemas.android.com/apk/res-auto"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical">
-
- <!-- This blank view pushes the other content down because of the tab carousel -->
- <view
- class="com.android.contacts.common.widget.ProportionalLayout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="@dimen/detail_contact_photo_shadow_height"
- ex:ratio="0.5"
- ex:direction="widthToHeight">
-
- <!-- Put a dummy view here because the ProportionalLayout requires one -->
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="match_parent"/>
-
- </view>
-
- <!-- "Recent" header text -->
- <FrameLayout
- android:layout_width="match_parent"
- android:layout_height="32dip"
- android:paddingLeft="16dip"
- android:paddingRight="16dip"
- android:paddingStart="16dip"
- android:paddingEnd="16dip"
- android:focusable="false">
-
- <TextView
- style="?android:attr/listSeparatorTextViewStyle"
- android:paddingLeft="8dip"
- android:paddingRight="8dip"
- android:paddingStart="8dip"
- android:paddingEnd="8dip"
- android:background="@drawable/list_section_divider_holo_custom"
- android:text="@string/recent"
- android:textColor="@color/people_app_theme_color"
- android:textAllCaps="true"
- android:singleLine="true"
- android:ellipsize="end" />
-
- </FrameLayout>
-
-</LinearLayout>
diff --git a/res/values-af/strings.xml b/res/values-af/strings.xml
index 92d65b1..e49db0f 100644
--- a/res/values-af/strings.xml
+++ b/res/values-af/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> van <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontakte"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Name van jou kontakte"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Geen program is gevind om hierdie aksie te hanteer nie."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Deel"</string>
<string name="share_via" msgid="563121028023030093">"Deel kontak met"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Skep groep onder rekening"</string>
diff --git a/res/values-am/strings.xml b/res/values-am/strings.xml
index fb98162..b6fa54b 100644
--- a/res/values-am/strings.xml
+++ b/res/values-am/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> ከ <xliff:g id="TOTAL_NUMBER">%s</xliff:g> እውቂያዎች"</string>
<string name="search_settings_description" msgid="2675223022992445813">"የዕውቂያዎችዎ ስሞች"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"ይህን እርምጃ ለማስተናገድ ምንም መተግበሪያ አልተገኘም፡፡"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"መጋሪያ"</string>
<string name="share_via" msgid="563121028023030093">"ዕውቂያበ በኩል አጋራ"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"በመለያ ስር ቡድን ፍጠር"</string>
diff --git a/res/values-ar/strings.xml b/res/values-ar/strings.xml
index 2c17b24..c6fb4db 100644
--- a/res/values-ar/strings.xml
+++ b/res/values-ar/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> من <xliff:g id="TOTAL_NUMBER">%s</xliff:g> من جهات الاتصال"</string>
<string name="search_settings_description" msgid="2675223022992445813">"أسماء جهات الاتصال"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"لم يتم العثور على تطبيق يمكنه مباشرة هذا الإجراء."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"مشاركة"</string>
<string name="share_via" msgid="563121028023030093">"مشاركة جهة الاتصال عبر"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"إنشاء مجموعة ضمن حساب"</string>
diff --git a/res/values-bg/strings.xml b/res/values-bg/strings.xml
index 49cbdfc..e89206b 100644
--- a/res/values-bg/strings.xml
+++ b/res/values-bg/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> от <xliff:g id="TOTAL_NUMBER">%s</xliff:g> контакта"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Имена на контактите ви"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Не бе намерено приложение за извършване на това действие."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Споделяне"</string>
<string name="share_via" msgid="563121028023030093">"Споделяне на контакт чрез"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Създаване на група в профил"</string>
diff --git a/res/values-ca/strings.xml b/res/values-ca/strings.xml
index f56c7f9..4c45fab 100644
--- a/res/values-ca/strings.xml
+++ b/res/values-ca/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> de <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contactes"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Noms dels contactes"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"No s\'ha trobat cap aplicació per processar aquesta acció."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Comparteix"</string>
<string name="share_via" msgid="563121028023030093">"Comparteix el contacte mitjançant"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Creació d\'un grup al compte"</string>
diff --git a/res/values-cs/strings.xml b/res/values-cs/strings.xml
index 3e0b312..04a95e5 100644
--- a/res/values-cs/strings.xml
+++ b/res/values-cs/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> z <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontaktů"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Jména vašich kontaktů"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Aplikace potřebná k provedení této akce nebyla nalezena."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Sdílet"</string>
<string name="share_via" msgid="563121028023030093">"Sdílet kontakt pomocí"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Vytvořit skupinu v účtu"</string>
diff --git a/res/values-da/strings.xml b/res/values-da/strings.xml
index 8a234cf..0820ca1 100644
--- a/res/values-da/strings.xml
+++ b/res/values-da/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> af <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontakter"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Navne på dine kontakter"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Der blev ikke fundet nogen app, der kan håndtere denne handling."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Del"</string>
<string name="share_via" msgid="563121028023030093">"Del kontakt via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Opret gruppe på konto"</string>
diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml
index 58cb503..6eb4cb8 100644
--- a/res/values-de/strings.xml
+++ b/res/values-de/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> von <xliff:g id="TOTAL_NUMBER">%s</xliff:g> Kontakten"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Namen meiner Kontakte"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Für diese Aktion wurde keine App gefunden."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Teilen"</string>
<string name="share_via" msgid="563121028023030093">"Kontakt teilen über"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Konto für Gruppenerstellung"</string>
diff --git a/res/values-el/strings.xml b/res/values-el/strings.xml
index 3f7f96b..33d0e35 100644
--- a/res/values-el/strings.xml
+++ b/res/values-el/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> από <xliff:g id="TOTAL_NUMBER">%s</xliff:g> επαφές"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Ονόματα των επαφών σας"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Δεν βρέθηκε εφαρμογή για τη διαχείριση αυτής της ενέργειας."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Κοινή χρήση"</string>
<string name="share_via" msgid="563121028023030093">"Κοινή χρήση μέσω"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Δημιουργία ομάδας στο λογαριασμό"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index ab2c827..81e871c 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> of <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contacts"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Names of your contacts"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"No app was found to handle this action."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Share"</string>
<string name="share_via" msgid="563121028023030093">"Share contact via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Create group under account"</string>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index ab2c827..81e871c 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> of <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contacts"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Names of your contacts"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"No app was found to handle this action."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Share"</string>
<string name="share_via" msgid="563121028023030093">"Share contact via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Create group under account"</string>
diff --git a/res/values-es-rUS/strings.xml b/res/values-es-rUS/strings.xml
index 212ce87..dbfb17b 100644
--- a/res/values-es-rUS/strings.xml
+++ b/res/values-es-rUS/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> de <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contactos"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nombres de tus contactos"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"No se encontró ninguna aplicación que pueda realizar esta acción."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Compartir"</string>
<string name="share_via" msgid="563121028023030093">"Compartir un contacto a través de"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Crear un grupo en la cuenta"</string>
diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml
index a779c24..a334a12 100644
--- a/res/values-es/strings.xml
+++ b/res/values-es/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> de <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contactos"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nombres de tus contactos"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"No se ha detectado ninguna aplicación que pueda hacer esta acción."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Compartir"</string>
<string name="share_via" msgid="563121028023030093">"Compartir contacto a través de"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Crear grupo en cuenta"</string>
diff --git a/res/values-et-rEE/strings.xml b/res/values-et-rEE/strings.xml
index 6290cbb..f2042cb 100644
--- a/res/values-et-rEE/strings.xml
+++ b/res/values-et-rEE/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g>/<xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontaktist"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Teie kontaktide nimed"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Selle toimingu käsitsemiseks ei leitud ühtegi rakendust."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Jaga"</string>
<string name="share_via" msgid="563121028023030093">"Kontakti jagamisvalikud"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Kontopõhise grupi loomine"</string>
diff --git a/res/values-fa/strings.xml b/res/values-fa/strings.xml
index 8a85497..435eb2b 100644
--- a/res/values-fa/strings.xml
+++ b/res/values-fa/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> از <xliff:g id="TOTAL_NUMBER">%s</xliff:g> مخاطب"</string>
<string name="search_settings_description" msgid="2675223022992445813">"نامهای مخاطبین شما"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"برنامهای برای انجام این عملکرد یافت نشد."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"اشتراکگذاری"</string>
<string name="share_via" msgid="563121028023030093">"اشتراکگذاری مخاطب از طریق"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"ایجاد گروه تحت حساب کاربری"</string>
diff --git a/res/values-fi/strings.xml b/res/values-fi/strings.xml
index ec75ce8..662db1b 100644
--- a/res/values-fi/strings.xml
+++ b/res/values-fi/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> / <xliff:g id="TOTAL_NUMBER">%s</xliff:g> yhteystietoa"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Yhteystietojen nimet"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Tätä toimintoa käsittelevää sovellusta ei löydy."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Jaa"</string>
<string name="share_via" msgid="563121028023030093">"Jaa yhteystieto"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Luo ryhmä tilissä"</string>
diff --git a/res/values-fr-rCA/strings.xml b/res/values-fr-rCA/strings.xml
index 49b328b..f05b8e0 100644
--- a/res/values-fr-rCA/strings.xml
+++ b/res/values-fr-rCA/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> sur <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contacts"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Noms de vos contacts"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Aucune application pouvant gérer cette action n\'a été trouvée."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Partager"</string>
<string name="share_via" msgid="563121028023030093">"Partager contact via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Sélectionner le compte associé au groupe"</string>
diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml
index b9df804..8292dd1 100644
--- a/res/values-fr/strings.xml
+++ b/res/values-fr/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> sur <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contacts"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Noms de vos contacts"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Aucune application pouvant gérer cette action n\'a été trouvée."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Partager"</string>
<string name="share_via" msgid="563121028023030093">"Partager contact via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Sélectionner le compte associé au groupe"</string>
diff --git a/res/values-hi/strings.xml b/res/values-hi/strings.xml
index df2105d..e37396a 100644
--- a/res/values-hi/strings.xml
+++ b/res/values-hi/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="TOTAL_NUMBER">%s</xliff:g> में से <xliff:g id="CURRENT_NUMBER">%s</xliff:g> संपर्क"</string>
<string name="search_settings_description" msgid="2675223022992445813">"आपके संपर्कों के नाम"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"यह कार्यवाही प्रबंधित करने के लिए कोई ऐप्स नहीं मिला."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"साझा करें"</string>
<string name="share_via" msgid="563121028023030093">"इसके द्वारा संपर्क साझा करें"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"खाते के तहत समूह बनाएं"</string>
diff --git a/res/values-hr/strings.xml b/res/values-hr/strings.xml
index fe832d8..abb5a0b 100644
--- a/res/values-hr/strings.xml
+++ b/res/values-hr/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> od <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontakata"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nazivi vaših kontakata"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nije pronađena nijedna aplikacija koja može provesti ovu radnju."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Podijeli"</string>
<string name="share_via" msgid="563121028023030093">"Dijeli kontakt putem"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Napravite skupinu pod računom"</string>
diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml
index 1a38ca8..f118676 100644
--- a/res/values-hu/strings.xml
+++ b/res/values-hu/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g>/<xliff:g id="TOTAL_NUMBER">%s</xliff:g> névjegy"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Ismerősök nevei"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nincs megfelelő alkalmazás a művelet elvégzésére."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Megosztás"</string>
<string name="share_via" msgid="563121028023030093">"Névjegy megosztása a következőn:"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Csoport létrehozása a fiókban"</string>
diff --git a/res/values-hy-rAM/strings.xml b/res/values-hy-rAM/strings.xml
index 00255c4..e8726ab 100644
--- a/res/values-hy-rAM/strings.xml
+++ b/res/values-hy-rAM/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g>-ը <xliff:g id="TOTAL_NUMBER">%s</xliff:g> կոնտակտից"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Ձեր կոնտակտների անունները"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Այս գործողությունը կատարելու համար ոչ մի ծրագիր չի գտնվել:"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Տարածել"</string>
<string name="share_via" msgid="563121028023030093">"Տարածել կոնտակտը"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Ստեղծել խումբ հաշվի ներքևում"</string>
diff --git a/res/values-in/strings.xml b/res/values-in/strings.xml
index 7ef0066..1a932f1 100644
--- a/res/values-in/strings.xml
+++ b/res/values-in/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> dari <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontak"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nama kontak Anda"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Tidak ada apl yang ditemukan untuk menangani tindakan ini."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Bagikan"</string>
<string name="share_via" msgid="563121028023030093">"Bagikan kontak melalui"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Buat grup dalam akun"</string>
diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml
index fc3f47a..e012a3b 100644
--- a/res/values-it/strings.xml
+++ b/res/values-it/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> contatti su <xliff:g id="TOTAL_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"I nomi dei tuoi contatti"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nessuna applicazione trovata per gestire questa azione."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Condividi"</string>
<string name="share_via" msgid="563121028023030093">"Condividi contatto tramite"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Crea un gruppo nell\'account"</string>
diff --git a/res/values-iw/strings.xml b/res/values-iw/strings.xml
index e0fbbab..5329b58 100644
--- a/res/values-iw/strings.xml
+++ b/res/values-iw/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> מתוך <xliff:g id="TOTAL_NUMBER">%s</xliff:g> אנשי קשר"</string>
<string name="search_settings_description" msgid="2675223022992445813">"השמות של אנשי הקשר"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"לא נמצאה אפליקציה שיכולה לטפל בפעולה זו."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"שתף"</string>
<string name="share_via" msgid="563121028023030093">"שתף איש קשר באמצעות"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"צור קבוצה עבור חשבון"</string>
diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml
index fe0d1d6..d1c445e 100644
--- a/res/values-ja/strings.xml
+++ b/res/values-ja/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g>/<xliff:g id="TOTAL_NUMBER">%s</xliff:g>件のファイル"</string>
<string name="search_settings_description" msgid="2675223022992445813">"連絡先の名前"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"この操作を行うアプリが見つかりませんでした。"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"共有"</string>
<string name="share_via" msgid="563121028023030093">"連絡先の共有ツール"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"次のアカウントにグループを作成"</string>
diff --git a/res/values-ka-rGE/strings.xml b/res/values-ka-rGE/strings.xml
index 0ae8d75..07446d2 100644
--- a/res/values-ka-rGE/strings.xml
+++ b/res/values-ka-rGE/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> (სულ <xliff:g id="TOTAL_NUMBER">%s</xliff:g> კონტაქტიდან)"</string>
<string name="search_settings_description" msgid="2675223022992445813">"თქვენი კონტაქტების სახელები"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"ამ მოქმედების შესასრულებლად აპი ვერ მოიძებნა."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"გაზიარება"</string>
<string name="share_via" msgid="563121028023030093">"კონტაქტის გაზიარება"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"ჯგუფის შექმნა ანგარიშში"</string>
diff --git a/res/values-km-rKH/strings.xml b/res/values-km-rKH/strings.xml
index 1652ee7..50a364d 100644
--- a/res/values-km-rKH/strings.xml
+++ b/res/values-km-rKH/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> នៃទំនាក់ទំនង <xliff:g id="TOTAL_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"ឈ្មោះនៃទំនាក់ទំនងរបស់អ្នក"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"រកមិនឃើញកម្មវិធីសម្រាប់សកម្មភាពនេះទេ។"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"ចែករំលែក"</string>
<string name="share_via" msgid="563121028023030093">"ចែករំលែកទំនាក់ទំនងតាម"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"បង្កើតក្រុមនៅក្នុងគណនី"</string>
diff --git a/res/values-ko/strings.xml b/res/values-ko/strings.xml
index 7e87929..2c6e4ad 100644
--- a/res/values-ko/strings.xml
+++ b/res/values-ko/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"연락처 <xliff:g id="CURRENT_NUMBER">%s</xliff:g>개(총 <xliff:g id="TOTAL_NUMBER">%s</xliff:g>개) 내보내는 중"</string>
<string name="search_settings_description" msgid="2675223022992445813">"연락처 명단"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"이 작업을 처리하는 앱을 찾을 수 없습니다."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"공유"</string>
<string name="share_via" msgid="563121028023030093">"연락처 공유에 사용할 애플리케이션:"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"계정에서 그룹 만들기"</string>
diff --git a/res/values-lo-rLA/strings.xml b/res/values-lo-rLA/strings.xml
index c5feced..c2fe949 100644
--- a/res/values-lo-rLA/strings.xml
+++ b/res/values-lo-rLA/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"ລາຍຊື່ຜູ່ຕິດຕໍ່ <xliff:g id="CURRENT_NUMBER">%s</xliff:g> ຈາກທັງໝົດ <xliff:g id="TOTAL_NUMBER">%s</xliff:g> ລາຍຊື່"</string>
<string name="search_settings_description" msgid="2675223022992445813">"ຊື່ຂອງລາຍຊື່ຜູ່ຕິດຕໍ່ຂອງທ່ານ"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"ບໍ່ພົບແອັບຯທີ່ໃຊ້ເພື່ອດຳເນີນການ."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"ແບ່ງປັນ"</string>
<string name="share_via" msgid="563121028023030093">"ແບ່ງປັນລາຍຊື່ຜູ່ຕິດຕໍ່ຜ່ານທາງ"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"ສ້າງກຸ່ມພາຍໃຕ້ບັນຊີ"</string>
diff --git a/res/values-lt/strings.xml b/res/values-lt/strings.xml
index d84bc86..b07f5bf 100644
--- a/res/values-lt/strings.xml
+++ b/res/values-lt/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> iš <xliff:g id="TOTAL_NUMBER">%s</xliff:g> adresatų"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Kontaktų vardai"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nerasta jokių programų šiam veiksmui apdoroti."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Bendrinti"</string>
<string name="share_via" msgid="563121028023030093">"Bendrinti adresatą naudojant"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Kurti grupę paskyroje"</string>
diff --git a/res/values-lv/strings.xml b/res/values-lv/strings.xml
index ee99707..93eade6 100644
--- a/res/values-lv/strings.xml
+++ b/res/values-lv/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> no <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontaktpersonas(-ām)"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Kontaktpersonu vārdi"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Netika atrasta neviena lietotne šīs darbības veikšanai."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Kopīgot"</string>
<string name="share_via" msgid="563121028023030093">"Kopīgot kontaktpersonu, izmantojot"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Izveidot grupu šajā kontā:"</string>
diff --git a/res/values-mn-rMN/strings.xml b/res/values-mn-rMN/strings.xml
index ee8f04c..0a2ce3f 100644
--- a/res/values-mn-rMN/strings.xml
+++ b/res/values-mn-rMN/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"нийт <xliff:g id="TOTAL_NUMBER">%s</xliff:g> харилцагчдын <xliff:g id="CURRENT_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Таны харилцагчдын нэрс"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Тус үйлдлийг гүйцэтгэх апп олдсонгүй."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Хуваалцах"</string>
<string name="share_via" msgid="563121028023030093">"Харилцагчийг дараахаар хуваалцах"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Акаунт дотор бүлгэм үүсгэх"</string>
diff --git a/res/values-ms-rMY/strings.xml b/res/values-ms-rMY/strings.xml
index b739040..51ed975 100644
--- a/res/values-ms-rMY/strings.xml
+++ b/res/values-ms-rMY/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> daripada <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kenalan"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nama kenalan anda"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Tiada aplikasi ditemui untuk mengendalikan tindakan ini."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Kongsi"</string>
<string name="share_via" msgid="563121028023030093">"Kongsi gambar melalui"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Buat kumpulan di bawah akaun"</string>
diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml
index c469e16..b2e7536 100644
--- a/res/values-nb/strings.xml
+++ b/res/values-nb/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> av <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontakter"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Navn på kontakter"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Det ble ikke funnet noen app som kan håndtere denne handlingen."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Del"</string>
<string name="share_via" msgid="563121028023030093">"Del kontakt via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Opprett gruppe under konto"</string>
diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml
index df5dd40..5d159d3 100644
--- a/res/values-nl/strings.xml
+++ b/res/values-nl/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> van <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contacten"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Namen van uw contacten"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Er is geen app gevonden om deze actie uit te voeren."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Delen"</string>
<string name="share_via" msgid="563121028023030093">"Contact delen via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Groep in account maken"</string>
diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml
index 3f18d90..f71425e 100644
--- a/res/values-pl/strings.xml
+++ b/res/values-pl/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"Kontakt <xliff:g id="CURRENT_NUMBER">%s</xliff:g> z <xliff:g id="TOTAL_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Imiona i nazwiska oraz nazwy w Twoich kontaktach"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nie znaleziono aplikacji do obsługi tego działania."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Udostępnij"</string>
<string name="share_via" msgid="563121028023030093">"Udostępnij kontakt przez"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Utwórz grupę na koncie"</string>
diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml
index 3e7e059..0ccacc6 100644
--- a/res/values-pt-rPT/strings.xml
+++ b/res/values-pt-rPT/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> de <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contactos"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nomes dos contactos"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Não foram encontradas aplicações para executar esta ação"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Partilhar"</string>
<string name="share_via" msgid="563121028023030093">"Partilhar contacto através de"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Criar grupo na conta"</string>
diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml
index aa7c1a8..248a7e4 100644
--- a/res/values-pt/strings.xml
+++ b/res/values-pt/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> de <xliff:g id="TOTAL_NUMBER">%s</xliff:g> contatos"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Nomes dos seus contatos"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nenhum aplicativo foi encontrado para executar esta ação."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Compartilhar"</string>
<string name="share_via" msgid="563121028023030093">"Compartilhar contato via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Criar grupo na conta"</string>
diff --git a/res/values-rm/strings.xml b/res/values-rm/strings.xml
index 69dff6c..e02ab3e 100644
--- a/res/values-rm/strings.xml
+++ b/res/values-rm/strings.xml
@@ -153,6 +153,8 @@
<string name="search_settings_description" msgid="2675223022992445813">"Num da Voss contacts"</string>
<!-- no translation found for quickcontact_missing_app (358168575340921552) -->
<skip />
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Cundivider"</string>
<string name="share_via" msgid="563121028023030093">"Cundivider in contact sur"</string>
<!-- no translation found for dialog_new_group_account (2318032089273496830) -->
diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml
index 2423b54..ef192da 100644
--- a/res/values-ro/strings.xml
+++ b/res/values-ro/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> din <xliff:g id="TOTAL_NUMBER">%s</xliff:g> (de) persoane din agendă"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Numele persoanelor din agenda dvs."</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Nu s-a găsit o aplicaţie care să gestioneze această acţiune."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Distribuiţi"</string>
<string name="share_via" msgid="563121028023030093">"Distribuiţi persoana din agendă prin"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Creaţi un grup în contul"</string>
diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml
index 7d9a3ed..55f0da2 100644
--- a/res/values-ru/strings.xml
+++ b/res/values-ru/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"Контакт <xliff:g id="CURRENT_NUMBER">%s</xliff:g> из <xliff:g id="TOTAL_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Имена контактов"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Действие не поддерживается ни в одном приложении."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Отправить"</string>
<string name="share_via" msgid="563121028023030093">"Способ отправки"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Создание группы в аккаунте"</string>
diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml
index a00127f..ed39d74 100644
--- a/res/values-sk/strings.xml
+++ b/res/values-sk/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> z <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontaktov"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Mená vašich kontaktov"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Aplikácia potrebná na spracovanie tejto akcie sa nenašla."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Zdieľať"</string>
<string name="share_via" msgid="563121028023030093">"Zdieľať kontakt pomocou"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Vytvoriť skupinu v účte"</string>
diff --git a/res/values-sl/strings.xml b/res/values-sl/strings.xml
index 4cf2670..f4629fb 100644
--- a/res/values-sl/strings.xml
+++ b/res/values-sl/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> od <xliff:g id="TOTAL_NUMBER">%s</xliff:g> stikov"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Imena stikov"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Programa za obravnavo tega dejanja ni mogoče najti."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Skupna raba"</string>
<string name="share_via" msgid="563121028023030093">"Deli stik z drugimi prek"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Ustvari skupino v računu"</string>
diff --git a/res/values-sr/strings.xml b/res/values-sr/strings.xml
index 72dd506..048e033 100644
--- a/res/values-sr/strings.xml
+++ b/res/values-sr/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> од <xliff:g id="TOTAL_NUMBER">%s</xliff:g> контак(а)та"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Имена контаката"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Није пронађена ниједна апликација која би могла да изврши ову радњу."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Дели"</string>
<string name="share_via" msgid="563121028023030093">"Дели контакт преко"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Прављење групе на налогу"</string>
diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml
index a190ef5..cd9c0b8 100644
--- a/res/values-sv/strings.xml
+++ b/res/values-sv/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> av <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kontakter"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Dina kontakters namn"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Ingen app som kan hantera åtgärden hittades."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Dela"</string>
<string name="share_via" msgid="563121028023030093">"Dela kontakt via"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Skapa grupp under konto"</string>
diff --git a/res/values-sw/strings.xml b/res/values-sw/strings.xml
index 5f70bbe..a85260d 100644
--- a/res/values-sw/strings.xml
+++ b/res/values-sw/strings.xml
@@ -39,7 +39,7 @@
<string name="searchHint" msgid="8482945356247760701">"Tafuta anwani"</string>
<string name="menu_viewContact" msgid="2795575601596468581">"Tazama anwani"</string>
<string name="menu_addStar" msgid="2908478235715404876">"Ongeza kwa vipendwa"</string>
- <string name="menu_removeStar" msgid="5844227078364227030">"Ondoa kutoka kwa vipendwa vyako"</string>
+ <string name="menu_removeStar" msgid="5844227078364227030">"Ondoa kwenye vipendwa"</string>
<string name="menu_editContact" msgid="9042415603857662633">"Hariri"</string>
<string name="menu_deleteContact" msgid="6788644058868189393">"Futa"</string>
<string name="menu_create_contact_shortcut" msgid="1217971915748509640">"Weka kwenye skrini ya Mwanzo"</string>
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> ya anwani <xliff:g id="TOTAL_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Majina ya anwani zako"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Hakuna programu iliyopatikana ya kushughulikia tendo hili."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Shiriki"</string>
<string name="share_via" msgid="563121028023030093">"Shiriki anwani kupitia"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Buni kikundi chini ya akaunti"</string>
diff --git a/res/values-sw600dp-land/integers.xml b/res/values-sw600dp-land/integers.xml
index 8ce96de..ff17b6d 100644
--- a/res/values-sw600dp-land/integers.xml
+++ b/res/values-sw600dp-land/integers.xml
@@ -15,5 +15,4 @@
-->
<resources>
<integer name="contact_tile_column_count">3</integer>
- <integer name="updates_tab_snippet_max_lines">7</integer>
</resources>
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 3e55240..8661ddc 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -24,9 +24,6 @@
<dimen name="shortcut_icon_size">64dip</dimen>
<dimen name="list_section_height">37dip</dimen>
<dimen name="group_detail_border_padding">16dip</dimen>
- <dimen name="detail_update_section_side_padding">0dip</dimen>
- <dimen name="detail_update_section_item_horizontal_padding">8dip</dimen>
- <dimen name="detail_update_section_item_vertical_padding">16dip</dimen>
<dimen name="search_view_width">400dip</dimen>
<dimen name="contact_tile_list_padding_top">16dip</dimen>
<!-- Center vertically -->
diff --git a/res/values-sw600dp/donottranslate_config.xml b/res/values-sw600dp/donottranslate_config.xml
index a8d428c..bbf37c1 100644
--- a/res/values-sw600dp/donottranslate_config.xml
+++ b/res/values-sw600dp/donottranslate_config.xml
@@ -23,6 +23,4 @@
<bool name="show_home_icon">true</bool>
<bool name="config_browse_list_show_images">false</bool>
<bool name="config_browse_list_reverse_images">false</bool>
- <item name="tab_width_screen_width_percentage" type="fraction">66.67%</item>
- <item name="tab_height_screen_width_percentage" type="fraction">66.67%</item>
</resources>
diff --git a/res/values-sw600dp/integers.xml b/res/values-sw600dp/integers.xml
index a62fa14..c629f7e 100644
--- a/res/values-sw600dp/integers.xml
+++ b/res/values-sw600dp/integers.xml
@@ -15,5 +15,4 @@
-->
<resources>
<integer name="contact_tile_column_count">2</integer>
- <integer name="updates_tab_snippet_max_lines">4</integer>
</resources>
diff --git a/res/values-sw720dp/integers.xml b/res/values-sw720dp/integers.xml
index eaf5971..c629f7e 100644
--- a/res/values-sw720dp/integers.xml
+++ b/res/values-sw720dp/integers.xml
@@ -15,5 +15,4 @@
-->
<resources>
<integer name="contact_tile_column_count">2</integer>
- <integer name="updates_tab_snippet_max_lines">7</integer>
</resources>
diff --git a/res/values-th/strings.xml b/res/values-th/strings.xml
index 3a7cd20..df9c8c5 100644
--- a/res/values-th/strings.xml
+++ b/res/values-th/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"รายชื่อในสมุดโทรศัพท์ <xliff:g id="CURRENT_NUMBER">%s</xliff:g> จาก <xliff:g id="TOTAL_NUMBER">%s</xliff:g> รายการ"</string>
<string name="search_settings_description" msgid="2675223022992445813">"ชื่อของรายชื่อในสมุดโทรศัพท์ของคุณ"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"ไม่พบแอปพลิเคชันสำหรับการทำงานนี้"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"ใช้ร่วมกัน"</string>
<string name="share_via" msgid="563121028023030093">"ใช้สมุดโทรศัพท์ร่วมกันทาง"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"สร้างกลุ่มภายในบัญชี"</string>
diff --git a/res/values-tl/strings.xml b/res/values-tl/strings.xml
index aec494c..fedd486 100644
--- a/res/values-tl/strings.xml
+++ b/res/values-tl/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> ng <xliff:g id="TOTAL_NUMBER">%s</xliff:g> (na) contact"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Mga pangalan ng iyong mga contact"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Walang natagpuang app na mangangasiwa sa pagkilos na ito."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Ibahagi"</string>
<string name="share_via" msgid="563121028023030093">"Ibahagi ang contact sa pamamagitan ng"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Lumikha ng pangkat sa ilalim ng account"</string>
diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml
index d3a572f..03704dd 100644
--- a/res/values-tr/strings.xml
+++ b/res/values-tr/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"Toplam <xliff:g id="TOTAL_NUMBER">%s</xliff:g> kişiden <xliff:g id="CURRENT_NUMBER">%s</xliff:g> kişi"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Kişilerinizin adları"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Bu işlemi gerçekleştirecek uygulama bulunamadı."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Paylaş"</string>
<string name="share_via" msgid="563121028023030093">"Şunu kullanarak kişi paylaş:"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Grubu şu hesabın altında oluştur:"</string>
diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml
index 373db15..504febf 100644
--- a/res/values-uk/strings.xml
+++ b/res/values-uk/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> із <xliff:g id="TOTAL_NUMBER">%s</xliff:g> контактів"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Імена ваших контактів"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Не знайдено програму для обробки цієї дії."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Надісл."</string>
<string name="share_via" msgid="563121028023030093">"Надісл. контакт через"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Створити групу в обліковому записі"</string>
diff --git a/res/values-vi/strings.xml b/res/values-vi/strings.xml
index 1f4af48..afc5406 100644
--- a/res/values-vi/strings.xml
+++ b/res/values-vi/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> trong tổng số <xliff:g id="TOTAL_NUMBER">%s</xliff:g> liên hệ"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Tên danh bạ của bạn"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Không tìm thấy ứng dụng nào để xử lý tác vụ này."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Chia sẻ"</string>
<string name="share_via" msgid="563121028023030093">"Chia sẻ liên hệ qua"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Tạo nhóm trong tài khoản"</string>
diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml
index 5af5f73..b895303 100644
--- a/res/values-zh-rCN/strings.xml
+++ b/res/values-zh-rCN/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"第 <xliff:g id="CURRENT_NUMBER">%s</xliff:g> 个联系人(共 <xliff:g id="TOTAL_NUMBER">%s</xliff:g> 个)"</string>
<string name="search_settings_description" msgid="2675223022992445813">"联系人姓名"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"未找到可处理此操作的应用。"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"分享"</string>
<string name="share_via" msgid="563121028023030093">"联系人分享方式"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"要在哪个帐户下创建群组?"</string>
diff --git a/res/values-zh-rHK/strings.xml b/res/values-zh-rHK/strings.xml
index 46c7605..1369575 100644
--- a/res/values-zh-rHK/strings.xml
+++ b/res/values-zh-rHK/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"第 <xliff:g id="CURRENT_NUMBER">%s</xliff:g> 位聯絡人,共 <xliff:g id="TOTAL_NUMBER">%s</xliff:g> 位"</string>
<string name="search_settings_description" msgid="2675223022992445813">"您的聯絡人姓名"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"找不到可以處理這個操作的應用程式。"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"分享"</string>
<string name="share_via" msgid="563121028023030093">"使用下列應用程式分享聯絡人資訊:"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"選擇帳戶以建立群組"</string>
diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml
index e1292cb..53475f1 100644
--- a/res/values-zh-rTW/strings.xml
+++ b/res/values-zh-rTW/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"第 <xliff:g id="CURRENT_NUMBER">%s</xliff:g> 位聯絡人,共 <xliff:g id="TOTAL_NUMBER">%s</xliff:g> 位"</string>
<string name="search_settings_description" msgid="2675223022992445813">"您的聯絡人姓名"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"找不到可以處理這個動作的應用程式。"</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"分享"</string>
<string name="share_via" msgid="563121028023030093">"使用下列應用程式分享聯絡人資訊:"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"選擇帳戶以建立群組"</string>
diff --git a/res/values-zu/strings.xml b/res/values-zu/strings.xml
index 95debfc..01786ad 100644
--- a/res/values-zu/strings.xml
+++ b/res/values-zu/strings.xml
@@ -119,6 +119,8 @@
<string name="exporting_contact_list_progress" msgid="560522409559101193">"<xliff:g id="CURRENT_NUMBER">%s</xliff:g> kothintana nabo abangu-<xliff:g id="TOTAL_NUMBER">%s</xliff:g>"</string>
<string name="search_settings_description" msgid="2675223022992445813">"Amagama othintana nabo"</string>
<string name="quickcontact_missing_app" msgid="358168575340921552">"Ayikho uhlelo lokusebenza etholakele ukubhekana nalengxenye."</string>
+ <!-- no translation found for missing_app (1466111003546611387) -->
+ <skip />
<string name="menu_share" msgid="943789700636542260">"Yabelana"</string>
<string name="share_via" msgid="563121028023030093">"Abelana nothintana naye nge"</string>
<string name="dialog_new_group_account" msgid="2318032089273496830">"Yenza isigcawu ngaphansi kwe-akhawunti"</string>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 362001d..f2ed2b8 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -30,12 +30,6 @@
<!-- Color used for the letter in the A-Z section header -->
<color name="section_header_text_color">#363636</color>
- <!-- Color of the text in the updates tab in the tab carousel on the contact detail page -->
- <color name="detail_update_tab_text_color">#777777</color>
-
- <!-- Color of the text of the tab carousel in the contact details -->
- <color name="detail_tab_carousel_tab_label_color">#EEEEEE</color>
-
<!-- Color of the background of the action bar -->
<color name="action_bar_background">#e6e6e6</color>
@@ -45,7 +39,4 @@
<!-- Color of the text for buttons in the action bar -->
<color name="action_bar_button_text_color">#FFFFFF</color>
- <!-- Color of the vertical stripe that goes on the left of a block quote inside a stream item -->
- <color name="stream_item_stripe_color">#CCCCCC</color>
-
</resources>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 598846a..40b4665 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -47,33 +47,6 @@
<!-- Height of the shadow asset under the photo on the contact detail page -->
<dimen name="detail_contact_photo_shadow_height">10dip</dimen>
- <!-- Height of the tab text label in the tab carousel on the contact detail page -->
- <dimen name="detail_tab_carousel_tab_label_height">45dip</dimen>
-
- <!-- Height of the tab text label in the tab carousel on the contact detail page -->
- <dimen name="detail_tab_carousel_tab_label_indent">24dip</dimen>
-
- <!-- Left and right padding of the text within the update tab in the tab carousel -->
- <dimen name="detail_update_tab_side_padding">24dip</dimen>
-
- <!-- Left and right padding of the update section in the contact detail card -->
- <dimen name="detail_update_section_side_padding">16dip</dimen>
-
- <!-- Vertical padding above and below individual stream items -->
- <dimen name="detail_update_section_item_vertical_padding">16dip</dimen>
-
- <!-- Vertical padding between text and images in a single stream item -->
- <dimen name="detail_update_section_between_items_vertical_padding">8dip</dimen>
-
- <!-- Horizontal padding for individual stream items -->
- <dimen name="detail_update_section_item_horizontal_padding">8dip</dimen>
-
- <!-- Padding between images in a single stream item -->
- <dimen name="detail_update_section_between_items_padding">1dip</dimen>
-
- <!-- Horizontal padding between attribution and comments -->
- <dimen name="detail_update_section_attribution_comments_padding">4dip</dimen>
-
<!-- Margin around the contact's photo on the contact card -->
<dimen name="detail_contact_photo_margin">8dip</dimen>
@@ -152,9 +125,6 @@
<dimen name="contact_filter_header_min_height">24dip</dimen>
- <!-- Width of the lead margin on the left of a block quote inside a stream item -->
- <dimen name="stream_item_stripe_width">8dip</dimen>
-
<!-- Max width of the SearchView when the contact picker is a dialog (on wide
screen devices). -->
<dimen name="contact_picker_search_view_max_width">550dip</dimen>
diff --git a/res/values/donottranslate_config.xml b/res/values/donottranslate_config.xml
index b74d8ce..dcf3039 100644
--- a/res/values/donottranslate_config.xml
+++ b/res/values/donottranslate_config.xml
@@ -47,14 +47,6 @@
-->
<bool name="config_show_group_action_in_action_bar">false</bool>
- <!-- Width of a tab in the tab carousel as a percentage of the current screen width on the
- contact detail page -->
- <item name="tab_width_screen_width_percentage" type="fraction">75%</item>
-
- <!-- Height of the tab carousel as a percentage of the current screen width on the
- contact detail page -->
- <item name="tab_height_screen_width_percentage" type="fraction">50%</item>
-
<!-- Help URL pointing to main TOC for People. This is intentionally empty because
the overlay will fill this in during build time. -->
<string name="help_url_people_main"></string>
diff --git a/res/values/integers.xml b/res/values/integers.xml
index e742ba0..6e312ae 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -17,7 +17,4 @@
<resources>
<!-- Determines the number of columns in a ContactTileRow -->
<integer name="contact_tile_column_count">2</integer>
-
- <!-- Max lines to display of a contact's snippet in the "updates" tab of the contact card tab carousel -->
- <integer name="updates_tab_snippet_max_lines">3</integer>
</resources>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index aa4cdf7..a117f5e 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -55,7 +55,6 @@
import com.android.contacts.activities.ActionBarAdapter.TabState;
import com.android.contacts.detail.ContactDetailFragment;
import com.android.contacts.detail.ContactDetailLayoutController;
-import com.android.contacts.detail.ContactDetailUpdatesFragment;
import com.android.contacts.detail.ContactLoaderFragment;
import com.android.contacts.detail.ContactLoaderFragment.ContactLoaderFragmentListener;
import com.android.contacts.common.ContactsUtils;
@@ -239,7 +238,7 @@
* However, there are special fragments which may not be in the layout, so we have to do the
* initialization here.
* The target fragments are:
- * - {@link ContactDetailFragment} and {@link ContactDetailUpdatesFragment}: They may not be
+ * - {@link ContactDetailFragment}: This may not be available
* in the layout depending on the configuration. (i.e. portrait)
* - {@link ContactsUnavailableFragment}: We always create it at runtime.
*/
diff --git a/src/com/android/contacts/detail/CarouselTab.java b/src/com/android/contacts/detail/CarouselTab.java
deleted file mode 100644
index 09e097a..0000000
--- a/src/com/android/contacts/detail/CarouselTab.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * 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.content.Context;
-import android.util.AttributeSet;
-import android.view.View;
-import android.view.ViewPropertyAnimator;
-import android.widget.TextView;
-
-import com.android.contacts.R;
-import com.android.contacts.widget.FrameLayoutWithOverlay;
-
-/**
- * This is a tab in the {@link ContactDetailTabCarousel}.
- */
-public class CarouselTab extends FrameLayoutWithOverlay {
-
- private static final String TAG = CarouselTab.class.getSimpleName();
-
- private static final long FADE_TRANSITION_TIME = 150;
-
- private TextView mLabelView;
- private View mLabelBackgroundView;
-
- /**
- * This view adds an alpha layer over the entire tab (except for the label).
- */
- private View mAlphaLayer;
-
- public CarouselTab(Context context, AttributeSet attrs) {
- super(context, attrs);
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
-
- mLabelView = (TextView) findViewById(R.id.label);
- mLabelBackgroundView = findViewById(R.id.label_background);
- mAlphaLayer = findViewById(R.id.alpha_overlay);
- setAlphaLayer(mAlphaLayer);
- }
-
- public void setLabel(String label) {
- mLabelView.setText(label);
- }
-
- public void showSelectedState() {
- mLabelView.setSelected(true);
- }
-
- public void showDeselectedState() {
- mLabelView.setSelected(false);
- }
-
- public void fadeInLabelViewAnimator(int startDelay, boolean fadeBackground) {
- final ViewPropertyAnimator labelAnimator = mLabelView.animate();
- mLabelView.setAlpha(0.0f);
- labelAnimator.alpha(1.0f);
- labelAnimator.setStartDelay(startDelay);
- labelAnimator.setDuration(FADE_TRANSITION_TIME);
-
- if (fadeBackground) {
- final ViewPropertyAnimator backgroundAnimator = mLabelBackgroundView.animate();
- mLabelBackgroundView.setAlpha(0.0f);
- backgroundAnimator.alpha(1.0f);
- backgroundAnimator.setStartDelay(startDelay);
- backgroundAnimator.setDuration(FADE_TRANSITION_TIME);
- }
- }
-}
diff --git a/src/com/android/contacts/detail/ContactDetailDisplayUtils.java b/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
index e1aa217..48aa0f7 100644
--- a/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
+++ b/src/com/android/contacts/detail/ContactDetailDisplayUtils.java
@@ -16,7 +16,16 @@
package com.android.contacts.detail;
-import android.content.ContentUris;
+import com.google.common.collect.Iterables;
+
+import com.android.contacts.R;
+import com.android.contacts.common.model.Contact;
+import com.android.contacts.common.model.RawContact;
+import com.android.contacts.common.model.dataitem.DataItem;
+import com.android.contacts.common.model.dataitem.OrganizationDataItem;
+import com.android.contacts.common.preference.ContactsPreferences;
+import com.android.contacts.util.MoreMath;
+
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
@@ -24,37 +33,17 @@
import android.content.res.Resources.NotFoundException;
import android.graphics.drawable.Drawable;
import android.net.Uri;
-import android.provider.ContactsContract;
import android.provider.ContactsContract.DisplayNameSources;
import android.provider.ContactsContract.Preferences;
-import android.provider.ContactsContract.StreamItems;
import android.text.Html;
-import android.text.Html.ImageGetter;
import android.text.TextUtils;
import android.util.Log;
-import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
-import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
-import com.android.contacts.common.ContactPhotoManager;
-import com.android.contacts.R;
-import com.android.contacts.common.model.Contact;
-import com.android.contacts.common.model.RawContact;
-import com.android.contacts.common.model.dataitem.DataItem;
-import com.android.contacts.common.model.dataitem.OrganizationDataItem;
-import com.android.contacts.common.preference.ContactsPreferences;
-import com.android.contacts.util.StreamItemEntry;
-import com.android.contacts.util.ContactBadgeUtil;
-import com.android.contacts.util.HtmlUtils;
-import com.android.contacts.util.MoreMath;
-import com.android.contacts.util.StreamItemPhotoEntry;
-import com.google.common.annotations.VisibleForTesting;
-import com.google.common.collect.Iterables;
-
import java.util.List;
/**
@@ -66,31 +55,6 @@
private static final String TAG = "ContactDetailDisplayUtils";
/**
- * Tag object used for stream item photos.
- */
- public static class StreamPhotoTag {
- public final StreamItemEntry streamItem;
- public final StreamItemPhotoEntry streamItemPhoto;
-
- public StreamPhotoTag(StreamItemEntry streamItem, StreamItemPhotoEntry streamItemPhoto) {
- this.streamItem = streamItem;
- this.streamItemPhoto = streamItemPhoto;
- }
-
- public Uri getStreamItemPhotoUri() {
- final Uri.Builder builder = StreamItems.CONTENT_URI.buildUpon();
- ContentUris.appendId(builder, streamItem.getId());
- builder.appendPath(StreamItems.StreamItemPhotos.CONTENT_DIRECTORY);
- ContentUris.appendId(builder, streamItemPhoto.getId());
- return builder.build();
- }
- }
-
- private ContactDetailDisplayUtils() {
- // Disallow explicit creation of this class.
- }
-
- /**
* Returns the display name of the contact, using the current display order setting.
* Returns res/string/missing_name if there is no display name.
*/
@@ -223,147 +187,6 @@
}
/**
- * Set the social snippet text. If there isn't one, then set the view to gone.
- */
- public static void setSocialSnippet(Context context, Contact contactData, TextView statusView,
- ImageView statusPhotoView) {
- if (statusView == null) {
- return;
- }
-
- CharSequence snippet = null;
- String photoUri = null;
- setDataOrHideIfNone(snippet, statusView);
- if (photoUri != null) {
- ContactPhotoManager.getInstance(context).loadPhoto(
- statusPhotoView, Uri.parse(photoUri), -1, false,
- ContactPhotoManager.DEFAULT_BLANK);
- statusPhotoView.setVisibility(View.VISIBLE);
- } else {
- statusPhotoView.setVisibility(View.GONE);
- }
- }
-
- /** Creates the view that represents a stream item. */
- public static View createStreamItemView(LayoutInflater inflater, Context context,
- View convertView, StreamItemEntry streamItem, View.OnClickListener photoClickListener) {
-
- // Try to recycle existing views.
- final View container;
- if (convertView != null) {
- container = convertView;
- } else {
- container = inflater.inflate(R.layout.stream_item_container, null, false);
- }
-
- final ContactPhotoManager contactPhotoManager = ContactPhotoManager.getInstance(context);
- final List<StreamItemPhotoEntry> photos = streamItem.getPhotos();
- final int photoCount = photos.size();
-
- // Add the text part.
- addStreamItemText(context, streamItem, container);
-
- // Add images.
- final ViewGroup imageRows = (ViewGroup) container.findViewById(R.id.stream_item_image_rows);
-
- if (photoCount == 0) {
- // This stream item only has text.
- imageRows.setVisibility(View.GONE);
- } else {
- // This stream item has text and photos.
- imageRows.setVisibility(View.VISIBLE);
-
- // Number of image rows needed, which is cailing(photoCount / 2)
- final int numImageRows = (photoCount + 1) / 2;
-
- // Actual image rows.
- final int numOldImageRows = imageRows.getChildCount();
-
- // Make sure we have enough stream_item_row_images.
- if (numOldImageRows == numImageRows) {
- // Great, we have the just enough number of rows...
-
- } else if (numOldImageRows < numImageRows) {
- // Need to add more image rows.
- for (int i = numOldImageRows; i < numImageRows; i++) {
- View imageRow = inflater.inflate(R.layout.stream_item_row_images, imageRows,
- true);
- }
- } else {
- // We have exceeding image rows. Hide them.
- for (int i = numImageRows; i < numOldImageRows; i++) {
- imageRows.getChildAt(i).setVisibility(View.GONE);
- }
- }
-
- // Put images, two by two.
- for (int i = 0; i < photoCount; i += 2) {
- final View imageRow = imageRows.getChildAt(i / 2);
- // Reused image rows may not visible, so make sure they're shown.
- imageRow.setVisibility(View.VISIBLE);
-
- // Show first image.
- loadPhoto(contactPhotoManager, streamItem, photos.get(i), imageRow,
- R.id.stream_item_first_image, photoClickListener);
- final View secondContainer = imageRow.findViewById(R.id.second_image_container);
- if (i + 1 < photoCount) {
- // Show the second image too.
- loadPhoto(contactPhotoManager, streamItem, photos.get(i + 1), imageRow,
- R.id.stream_item_second_image, photoClickListener);
- secondContainer.setVisibility(View.VISIBLE);
- } else {
- // Hide the second image, but it still has to occupy the space.
- secondContainer.setVisibility(View.INVISIBLE);
- }
- }
- }
-
- return container;
- }
-
- /** Loads a photo into an image view. The image view is identified by the given id. */
- private static void loadPhoto(ContactPhotoManager contactPhotoManager,
- final StreamItemEntry streamItem, final StreamItemPhotoEntry streamItemPhoto,
- View photoContainer, int imageViewId, View.OnClickListener photoClickListener) {
- final View frame = photoContainer.findViewById(imageViewId);
- final View pushLayerView = frame.findViewById(R.id.push_layer);
- final ImageView imageView = (ImageView) frame.findViewById(R.id.image);
- if (photoClickListener != null) {
- pushLayerView.setOnClickListener(photoClickListener);
- pushLayerView.setTag(new StreamPhotoTag(streamItem, streamItemPhoto));
- pushLayerView.setFocusable(true);
- pushLayerView.setEnabled(true);
- } else {
- pushLayerView.setOnClickListener(null);
- pushLayerView.setTag(null);
- pushLayerView.setFocusable(false);
- // setOnClickListener makes it clickable, so we need to overwrite it
- pushLayerView.setClickable(false);
- pushLayerView.setEnabled(false);
- }
- contactPhotoManager.loadPhoto(imageView, Uri.parse(streamItemPhoto.getPhotoUri()), -1,
- false, ContactPhotoManager.DEFAULT_BLANK);
- }
-
- @VisibleForTesting
- static View addStreamItemText(Context context, StreamItemEntry streamItem, View rootView) {
- TextView htmlView = (TextView) rootView.findViewById(R.id.stream_item_html);
- TextView attributionView = (TextView) rootView.findViewById(
- R.id.stream_item_attribution);
- TextView commentsView = (TextView) rootView.findViewById(R.id.stream_item_comments);
- ImageGetter imageGetter = new DefaultImageGetter(context.getPackageManager());
-
- // Stream item text
- setDataOrHideIfNone(streamItem.getDecodedText(), htmlView);
- // Attribution
- setDataOrHideIfNone(ContactBadgeUtil.getSocialDate(streamItem, context),
- attributionView);
- // Comments
- setDataOrHideIfNone(streamItem.getDecodedComments(), commentsView);
- return rootView;
- }
-
- /**
* Sets the display name of this contact to the given {@link TextView}. If
* there is none, then set the view to gone.
*/
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 629e36b..6573fa2 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -161,7 +161,6 @@
private Button mQuickFixButton;
private QuickFix mQuickFix;
- private boolean mContactHasSocialUpdates;
private boolean mShowStaticPhoto = true;
private final QuickFix[] mPotentialQuickFixes = new QuickFix[] {
diff --git a/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java b/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
deleted file mode 100644
index 434d8f5..0000000
--- a/src/com/android/contacts/detail/ContactDetailFragmentCarousel.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * 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.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.view.ViewPropertyAnimator;
-import android.widget.HorizontalScrollView;
-
-import com.android.contacts.R;
-import com.android.contacts.widget.FrameLayoutWithOverlay;
-
-/**
- * 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 touch interceptors over each fragment are configured accordingly.
- */
-public class ContactDetailFragmentCarousel extends HorizontalScrollView implements OnTouchListener {
-
- private static final String TAG = ContactDetailFragmentCarousel.class.getSimpleName();
-
- /**
- * Number of pixels that this view can be scrolled horizontally.
- */
- private int mAllowedHorizontalScrollLength = Integer.MIN_VALUE;
-
- /**
- * 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 mLowerThreshold = Integer.MIN_VALUE;
-
- /**
- * 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 mUpperThreshold = Integer.MIN_VALUE;
-
- /**
- * Minimum width of a fragment (if there is more than 1 fragment in the carousel, then this is
- * the width of one of the fragments).
- */
- private int mMinFragmentWidth = Integer.MIN_VALUE;
-
- /**
- * Fragment width (if there are 1+ fragments in the carousel) as defined as a fraction of the
- * screen width.
- */
- private static final float FRAGMENT_WIDTH_SCREEN_WIDTH_FRACTION = 0.85f;
-
- private static final int ABOUT_PAGE = 0;
- private static final int UPDATES_PAGE = 1;
-
- private static final int MAX_FRAGMENT_VIEW_COUNT = 2;
-
- private boolean mEnableSwipe;
-
- private int mCurrentPage = ABOUT_PAGE;
- private int mLastScrollPosition;
-
- private FrameLayoutWithOverlay mAboutFragment;
- private FrameLayoutWithOverlay mUpdatesFragment;
-
- 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);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int screenWidth = MeasureSpec.getSize(widthMeasureSpec);
- int screenHeight = MeasureSpec.getSize(heightMeasureSpec);
-
- // Take the width of this view as the width of the screen and compute necessary thresholds.
- // Only do this computation 1x.
- if (mAllowedHorizontalScrollLength == Integer.MIN_VALUE) {
- mMinFragmentWidth = (int) (FRAGMENT_WIDTH_SCREEN_WIDTH_FRACTION * screenWidth);
- mAllowedHorizontalScrollLength = (MAX_FRAGMENT_VIEW_COUNT * mMinFragmentWidth) -
- screenWidth;
- mLowerThreshold = (screenWidth - mMinFragmentWidth) / MAX_FRAGMENT_VIEW_COUNT;
- mUpperThreshold = mAllowedHorizontalScrollLength - mLowerThreshold;
- }
-
- if (getChildCount() > 0) {
- View child = getChildAt(0);
- // If we enable swipe, then the {@link LinearLayout} child width must be the sum of the
- // width of all its children fragments.
- // Or the current page may already be set to something other than the first. If so,
- // it also means there are multiple child fragments.
- if (mEnableSwipe || mCurrentPage == 1 ||
- (mCurrentPage == 0 && getLayoutDirection() == View.LAYOUT_DIRECTION_RTL)) {
- child.measure(MeasureSpec.makeMeasureSpec(
- mMinFragmentWidth * MAX_FRAGMENT_VIEW_COUNT, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(screenHeight, MeasureSpec.EXACTLY));
- } else {
- // Otherwise, the {@link LinearLayout} child width will just be the screen width
- // because it will only have 1 child fragment.
- child.measure(MeasureSpec.makeMeasureSpec(screenWidth, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(screenHeight, MeasureSpec.EXACTLY));
- }
- }
-
- setMeasuredDimension(
- resolveSize(screenWidth, widthMeasureSpec),
- resolveSize(screenHeight, heightMeasureSpec));
- }
-
- /**
- * Set the current page. This dims out the non-selected page but doesn't do any scrolling of
- * the carousel.
- */
- public void setCurrentPage(int pageIndex) {
- mCurrentPage = pageIndex;
-
- updateTouchInterceptors();
- }
-
- /**
- * Set the view containers for the detail and updates fragment.
- */
- public void setFragmentViews(FrameLayoutWithOverlay about, FrameLayoutWithOverlay updates) {
- mAboutFragment = about;
- mUpdatesFragment = updates;
-
- mAboutFragment.setOverlayOnClickListener(mAboutFragTouchInterceptListener);
- mUpdatesFragment.setOverlayOnClickListener(mUpdatesFragTouchInterceptListener);
- }
-
- /**
- * Enable swiping if the detail and update fragments should be showing. Otherwise disable
- * swiping if only the detail fragment should be showing.
- */
- public void enableSwipe(boolean enable) {
- if (mEnableSwipe != enable) {
- mEnableSwipe = enable;
- if (mUpdatesFragment != null) {
- mUpdatesFragment.setVisibility(enable ? View.VISIBLE : View.GONE);
- snapToEdge();
- updateTouchInterceptors();
- }
- }
- }
-
- /**
- * Reset the fragment carousel to show the about page.
- */
- public void reset() {
- if (mCurrentPage != ABOUT_PAGE) {
- mCurrentPage = ABOUT_PAGE;
- snapToEdgeSmooth();
- }
- }
-
- public int getCurrentPage() {
- return mCurrentPage;
- }
-
- private final OnClickListener mAboutFragTouchInterceptListener = new OnClickListener() {
- @Override
- public void onClick(View v) {
- mCurrentPage = ABOUT_PAGE;
- snapToEdgeSmooth();
- }
- };
-
- private final OnClickListener mUpdatesFragTouchInterceptListener = new OnClickListener() {
- @Override
- public void onClick(View v) {
- mCurrentPage = UPDATES_PAGE;
- snapToEdgeSmooth();
- }
- };
-
- private void updateTouchInterceptors() {
- // Disable the touch-interceptor on the selected page, and enable it on the other.
- if (mAboutFragment != null) {
- mAboutFragment.setOverlayClickable(mCurrentPage != ABOUT_PAGE);
- }
- if (mUpdatesFragment != null) {
- mUpdatesFragment.setOverlayClickable(mCurrentPage != UPDATES_PAGE);
- }
- }
-
- @Override
- protected void onScrollChanged(int l, int t, int oldl, int oldt) {
- super.onScrollChanged(l, t, oldl, oldt);
- if (!mEnableSwipe) {
- return;
- }
- mLastScrollPosition = l;
- }
-
- /**
- * Used to set initial scroll offset. Not smooth.
- */
- private void snapToEdge() {
- setScrollX(calculateHorizontalOffset());
- updateTouchInterceptors();
- }
-
- /**
- * Smooth version of snapToEdge().
- */
- private void snapToEdgeSmooth() {
- smoothScrollTo(calculateHorizontalOffset(), 0);
- updateTouchInterceptors();
- }
-
- private int calculateHorizontalOffset() {
- int offset;
- if (getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
- offset = (mCurrentPage == ABOUT_PAGE) ? mAllowedHorizontalScrollLength : 0;
- } else {
- offset = (mCurrentPage == ABOUT_PAGE) ? 0 : mAllowedHorizontalScrollLength;
- }
- return offset;
- }
-
- /**
- * 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 (getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
- // 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 > mLowerThreshold) ? UPDATES_PAGE : ABOUT_PAGE;
- } else {
- return (mLastScrollPosition < mUpperThreshold) ? UPDATES_PAGE : ABOUT_PAGE;
- }
- case UPDATES_PAGE:
- if (getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
- // 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 < mUpperThreshold) ? ABOUT_PAGE : UPDATES_PAGE;
- } else {
- return (mLastScrollPosition > mLowerThreshold) ? ABOUT_PAGE : UPDATES_PAGE;
- }
- }
- throw new IllegalStateException("Invalid current page " + mCurrentPage);
- }
-
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- if (!mEnableSwipe) {
- return false;
- }
- if (event.getAction() == MotionEvent.ACTION_UP) {
- mCurrentPage = getDesiredPage();
- snapToEdgeSmooth();
- return true;
- }
- return false;
- }
-
- /**
- * Starts an "appear" animation by moving in the "Updates" from the right.
- */
- public void animateAppear() {
- final int x = Math.round((1.0f - FRAGMENT_WIDTH_SCREEN_WIDTH_FRACTION) * getWidth());
- mUpdatesFragment.setTranslationX(x);
- final ViewPropertyAnimator animator = mUpdatesFragment.animate();
- animator.translationX(0.0f);
- }
-}
diff --git a/src/com/android/contacts/detail/ContactDetailLayoutController.java b/src/com/android/contacts/detail/ContactDetailLayoutController.java
index 1ee31a5..7e412e0 100644
--- a/src/com/android/contacts/detail/ContactDetailLayoutController.java
+++ b/src/com/android/contacts/detail/ContactDetailLayoutController.java
@@ -16,101 +16,44 @@
package com.android.contacts.detail;
-import android.animation.Animator;
-import android.animation.Animator.AnimatorListener;
-import android.animation.ObjectAnimator;
import android.app.Activity;
import android.app.FragmentManager;
-import android.app.FragmentTransaction;
-import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
-import android.support.v4.view.ViewPager;
-import android.support.v4.view.ViewPager.OnPageChangeListener;
-import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewPropertyAnimator;
-import android.view.animation.AnimationUtils;
-import android.widget.AbsListView;
-import android.widget.AbsListView.OnScrollListener;
import com.android.contacts.NfcHandler;
-import com.android.contacts.R;
+import com.android.contacts.R.id;
import com.android.contacts.activities.ContactDetailActivity.FragmentKeyListener;
import com.android.contacts.common.model.Contact;
import com.android.contacts.util.PhoneCapabilityTester;
import com.android.contacts.common.util.UriUtils;
-import com.android.contacts.widget.FrameLayoutWithOverlay;
import com.android.contacts.widget.TransitionAnimationView;
/**
- * Determines the layout of the contact card.
+ * Sets ContactDetailFragment data and performs animations when data changes.
+ *
+ * TODO: rename, move some of this logic into ContactDetailFragment and/or delete this class. This
+ * class used to have more responsibility: the ContactDetailFragment was used beside social update
+ * Fragments.
*/
public class ContactDetailLayoutController {
private static final String KEY_CONTACT_URI = "contactUri";
- private static final String KEY_CONTACT_HAS_UPDATES = "contactHasUpdates";
- private static final String KEY_CURRENT_PAGE_INDEX = "currentPageIndex";
-
- private static final int TAB_INDEX_DETAIL = 0;
- private static final int TAB_INDEX_UPDATES = 1;
private final int SINGLE_PANE_FADE_IN_DURATION = 275;
- /**
- * There are 4 possible layouts for the contact detail screen: TWO_COLUMN,
- * VIEW_PAGER_AND_TAB_CAROUSEL, FRAGMENT_CAROUSEL, and TWO_COLUMN_FRAGMENT_CAROUSEL.
- */
- private interface LayoutMode {
- /**
- * Tall and wide screen with details and updates shown side-by-side.
- */
- static final int TWO_COLUMN = 0;
- /**
- * Tall and narrow screen to allow swipe between the details and updates.
- */
- static final int VIEW_PAGER_AND_TAB_CAROUSEL = 1;
- /**
- * Short and wide screen to allow part of the other page to show.
- */
- static final int FRAGMENT_CAROUSEL = 2;
- /**
- * Same as FRAGMENT_CAROUSEL (allowing part of the other page to show) except the details
- * layout is similar to the details layout in TWO_COLUMN mode.
- */
- static final int TWO_COLUMN_FRAGMENT_CAROUSEL = 3;
- }
-
private final Activity mActivity;
- private final LayoutInflater mLayoutInflater;
private final FragmentManager mFragmentManager;
-
- private final View mViewContainer;
- private final TransitionAnimationView mTransitionAnimationView;
- private ContactDetailFragment mDetailFragment;
- private ContactDetailUpdatesFragment mUpdatesFragment;
-
- private View mDetailFragmentView;
- private View mUpdatesFragmentView;
-
- private final ViewPager mViewPager;
- private ContactDetailViewPagerAdapter mViewPagerAdapter;
- private int mViewPagerState;
-
- private final ContactDetailTabCarousel mTabCarousel;
- private final ContactDetailFragmentCarousel mFragmentCarousel;
-
private final ContactDetailFragment.Listener mContactDetailFragmentListener;
+ private final TransitionAnimationView mTransitionAnimationView;
+ private final View mViewContainer;
+ private ContactDetailFragment mDetailFragment;
private Contact mContactData;
private Uri mContactUri;
- private boolean mTabCarouselIsAnimating;
-
- private boolean mContactHasUpdates;
-
- private int mLayoutMode;
-
public ContactDetailLayoutController(Activity activity, Bundle savedState,
FragmentManager fragmentManager, TransitionAnimationView animationView,
View viewContainer, ContactDetailFragment.Listener contactDetailFragmentListener) {
@@ -121,165 +64,36 @@
}
mActivity = activity;
- mLayoutInflater = (LayoutInflater) activity.getSystemService(
- Context.LAYOUT_INFLATER_SERVICE);
mFragmentManager = fragmentManager;
mContactDetailFragmentListener = contactDetailFragmentListener;
-
mTransitionAnimationView = animationView;
-
- // Retrieve views in case this is view pager and carousel mode
mViewContainer = viewContainer;
- mViewPager = (ViewPager) viewContainer.findViewById(R.id.pager);
- mTabCarousel = (ContactDetailTabCarousel) viewContainer.findViewById(R.id.tab_carousel);
-
- // Retrieve view in case this is in fragment carousel mode
- mFragmentCarousel = (ContactDetailFragmentCarousel) viewContainer.findViewById(
- R.id.fragment_carousel);
-
- // Retrieve container views in case they are already in the XML layout
- mDetailFragmentView = viewContainer.findViewById(R.id.about_fragment_container);
- mUpdatesFragmentView = viewContainer.findViewById(R.id.updates_fragment_container);
-
- // Determine the layout mode based on the presence of certain views in the layout XML.
- if (mViewPager != null) {
- mLayoutMode = LayoutMode.VIEW_PAGER_AND_TAB_CAROUSEL;
- } else if (mFragmentCarousel != null) {
- if (PhoneCapabilityTester.isUsingTwoPanes(mActivity)) {
- mLayoutMode = LayoutMode.TWO_COLUMN_FRAGMENT_CAROUSEL;
- } else {
- mLayoutMode = LayoutMode.FRAGMENT_CAROUSEL;
- }
- } else {
- mLayoutMode = LayoutMode.TWO_COLUMN;
- }
-
initialize(savedState);
}
private void initialize(Bundle savedState) {
- boolean fragmentsAddedToFragmentManager = true;
- mDetailFragment = (ContactDetailFragment) mFragmentManager.findFragmentByTag(
- ContactDetailViewPagerAdapter.ABOUT_FRAGMENT_TAG);
- mUpdatesFragment = (ContactDetailUpdatesFragment) mFragmentManager.findFragmentByTag(
- ContactDetailViewPagerAdapter.UPDATES_FRAGMENT_TAG);
-
- // If the detail fragment was found in the {@link FragmentManager} then we don't need to add
- // it again. Otherwise, create the fragments dynamically and remember to add them to the
- // {@link FragmentManager}.
- if (mDetailFragment == null) {
- mDetailFragment = new ContactDetailFragment();
- mUpdatesFragment = new ContactDetailUpdatesFragment();
- fragmentsAddedToFragmentManager = false;
- }
+ mDetailFragment = (ContactDetailFragment) mFragmentManager
+ .findFragmentById(id.contact_detail_about_fragment);
mDetailFragment.setListener(mContactDetailFragmentListener);
NfcHandler.register(mActivity, mDetailFragment);
- // Read from savedState if possible
- int currentPageIndex = 0;
if (savedState != null) {
mContactUri = savedState.getParcelable(KEY_CONTACT_URI);
- mContactHasUpdates = savedState.getBoolean(KEY_CONTACT_HAS_UPDATES);
- currentPageIndex = savedState.getInt(KEY_CURRENT_PAGE_INDEX, 0);
- }
- switch (mLayoutMode) {
- case LayoutMode.VIEW_PAGER_AND_TAB_CAROUSEL: {
- // Inflate 2 view containers to pass in as children to the {@link ViewPager},
- // which will in turn be the parents to the mDetailFragment and mUpdatesFragment
- // since the fragments must have the same parent view IDs in both landscape and
- // portrait layouts.
- mDetailFragmentView = mLayoutInflater.inflate(
- R.layout.contact_detail_about_fragment_container, mViewPager, false);
- mUpdatesFragmentView = mLayoutInflater.inflate(
- R.layout.contact_detail_updates_fragment_container, mViewPager, false);
-
- mViewPagerAdapter = new ContactDetailViewPagerAdapter();
- mViewPagerAdapter.setAboutFragmentView(mDetailFragmentView);
- mViewPagerAdapter.setUpdatesFragmentView(mUpdatesFragmentView);
-
- mViewPager.addView(mDetailFragmentView);
- mViewPager.addView(mUpdatesFragmentView);
- mViewPager.setAdapter(mViewPagerAdapter);
- mViewPager.setOnPageChangeListener(mOnPageChangeListener);
-
- if (!fragmentsAddedToFragmentManager) {
- FragmentTransaction transaction = mFragmentManager.beginTransaction();
- transaction.add(R.id.about_fragment_container, mDetailFragment,
- ContactDetailViewPagerAdapter.ABOUT_FRAGMENT_TAG);
- transaction.add(R.id.updates_fragment_container, mUpdatesFragment,
- ContactDetailViewPagerAdapter.UPDATES_FRAGMENT_TAG);
- transaction.commitAllowingStateLoss();
- mFragmentManager.executePendingTransactions();
- }
-
- mTabCarousel.setListener(mTabCarouselListener);
- mTabCarousel.restoreCurrentTab(currentPageIndex);
- mDetailFragment.setVerticalScrollListener(
- new VerticalScrollListener(TAB_INDEX_DETAIL));
- mUpdatesFragment.setVerticalScrollListener(
- new VerticalScrollListener(TAB_INDEX_UPDATES));
- mViewPager.setCurrentItem(currentPageIndex);
- break;
- }
- case LayoutMode.TWO_COLUMN: {
- if (!fragmentsAddedToFragmentManager) {
- FragmentTransaction transaction = mFragmentManager.beginTransaction();
- transaction.add(R.id.about_fragment_container, mDetailFragment,
- ContactDetailViewPagerAdapter.ABOUT_FRAGMENT_TAG);
- transaction.add(R.id.updates_fragment_container, mUpdatesFragment,
- ContactDetailViewPagerAdapter.UPDATES_FRAGMENT_TAG);
- transaction.commitAllowingStateLoss();
- mFragmentManager.executePendingTransactions();
- }
- break;
- }
- case LayoutMode.FRAGMENT_CAROUSEL:
- case LayoutMode.TWO_COLUMN_FRAGMENT_CAROUSEL: {
- // Add the fragments to the fragment containers in the carousel using a
- // {@link FragmentTransaction} if they haven't already been added to the
- // {@link FragmentManager}.
- if (!fragmentsAddedToFragmentManager) {
- FragmentTransaction transaction = mFragmentManager.beginTransaction();
- transaction.add(R.id.about_fragment_container, mDetailFragment,
- ContactDetailViewPagerAdapter.ABOUT_FRAGMENT_TAG);
- transaction.add(R.id.updates_fragment_container, mUpdatesFragment,
- ContactDetailViewPagerAdapter.UPDATES_FRAGMENT_TAG);
- transaction.commitAllowingStateLoss();
- mFragmentManager.executePendingTransactions();
- }
-
- mFragmentCarousel.setFragmentViews(
- (FrameLayoutWithOverlay) mDetailFragmentView,
- (FrameLayoutWithOverlay) mUpdatesFragmentView);
- mFragmentCarousel.setCurrentPage(currentPageIndex);
-
- break;
- }
- }
-
- // Setup the layout if we already have a saved state
- if (savedState != null) {
- if (mContactHasUpdates) {
- showContactWithUpdates(false);
- } else {
- showContactWithoutUpdates();
- }
+ // Immediately setup layout since we have saved state
+ showContact();
}
}
public void setContactData(Contact data) {
final boolean contactWasLoaded;
- final boolean contactHadUpdates;
final boolean isDifferentContact;
if (mContactData == null) {
- contactHadUpdates = false;
contactWasLoaded = false;
isDifferentContact = true;
} else {
- contactHadUpdates = mContactHasUpdates;
contactWasLoaded = true;
isDifferentContact =
!UriUtils.areEqual(mContactData.getLookupUri(), data.getLookupUri());
@@ -301,50 +115,15 @@
}
}
- showContactWithoutUpdates();
+ showContact();
}
public void showEmptyState() {
- switch (mLayoutMode) {
- case LayoutMode.FRAGMENT_CAROUSEL: {
- mFragmentCarousel.setCurrentPage(0);
- mFragmentCarousel.enableSwipe(false);
- mDetailFragment.showEmptyState();
- break;
- }
- case LayoutMode.TWO_COLUMN: {
- mDetailFragment.setShowStaticPhoto(false);
- mUpdatesFragmentView.setVisibility(View.GONE);
- mDetailFragment.showEmptyState();
- break;
- }
- case LayoutMode.TWO_COLUMN_FRAGMENT_CAROUSEL: {
- mFragmentCarousel.setCurrentPage(0);
- mFragmentCarousel.enableSwipe(false);
- mDetailFragment.setShowStaticPhoto(false);
- mUpdatesFragmentView.setVisibility(View.GONE);
- mDetailFragment.showEmptyState();
- break;
- }
- case LayoutMode.VIEW_PAGER_AND_TAB_CAROUSEL: {
- mDetailFragment.setShowStaticPhoto(false);
- mDetailFragment.showEmptyState();
- mTabCarousel.loadData(null);
- mTabCarousel.setVisibility(View.GONE);
- mViewPagerAdapter.enableSwipe(false);
- mViewPager.setCurrentItem(0);
- break;
- }
- default:
- throw new IllegalStateException("Invalid LayoutMode " + mLayoutMode);
- }
+ mDetailFragment.setShowStaticPhoto(false);
+ mDetailFragment.showEmptyState();
}
- /**
- * Setup the layout for the contact with updates.
- * TODO: Clean up this method so it's easier to understand.
- */
- private void showContactWithUpdates(boolean animateStateChange) {
+ private void showContact() {
if (mContactData == null) {
return;
}
@@ -353,390 +132,20 @@
mContactUri = mContactData.getLookupUri();
boolean isDifferentContact = !UriUtils.areEqual(previousContactUri, mContactUri);
- switch (mLayoutMode) {
- case LayoutMode.TWO_COLUMN: {
- if (!isDifferentContact && animateStateChange) {
- // This is screen is very hard to animate properly, because there is such a hard
- // cut from the regular version. A proper animation would have to reflow text
- // and move things around. Doing a simple cross-fade instead.
- mTransitionAnimationView.startMaskTransition(false, -1);
- }
-
- // Set the contact data (hide the static photo because the photo will already be in
- // the header that scrolls with contact details).
- mDetailFragment.setShowStaticPhoto(false);
- // Show the updates fragment
- mUpdatesFragmentView.setVisibility(View.VISIBLE);
- break;
- }
- case LayoutMode.VIEW_PAGER_AND_TAB_CAROUSEL: {
- // Update and show the tab carousel (also restore its last saved position)
- mTabCarousel.loadData(mContactData);
- mTabCarousel.restoreYCoordinate();
- mTabCarousel.setVisibility(View.VISIBLE);
- // Update ViewPager to allow swipe between all the fragments (to see updates)
- mViewPagerAdapter.enableSwipe(true);
- // If this is a different contact than before, then reset some views.
- if (isDifferentContact) {
- resetViewPager();
- resetTabCarousel();
- }
- if (!isDifferentContact && animateStateChange) {
- mTabCarousel.animateAppear(mViewContainer.getWidth(),
- mDetailFragment.getFirstListItemOffset());
- }
- break;
- }
- case LayoutMode.FRAGMENT_CAROUSEL: {
- // Allow swiping between all fragments
- mFragmentCarousel.enableSwipe(true);
- if (!isDifferentContact && animateStateChange) {
- mFragmentCarousel.animateAppear();
- }
- break;
- }
- case LayoutMode.TWO_COLUMN_FRAGMENT_CAROUSEL: {
- // Allow swiping between all fragments
- mFragmentCarousel.enableSwipe(true);
- if (isDifferentContact) {
- mFragmentCarousel.reset();
- }
- if (!isDifferentContact && animateStateChange) {
- mFragmentCarousel.animateAppear();
- }
- mDetailFragment.setShowStaticPhoto(false);
- break;
- }
- default:
- throw new IllegalStateException("Invalid LayoutMode " + mLayoutMode);
- }
+ mDetailFragment.setShowStaticPhoto(true);
if (isDifferentContact) {
- resetFragments();
+ mDetailFragment.resetAdapter();
}
mDetailFragment.setData(mContactUri, mContactData);
- mUpdatesFragment.setData(mContactUri, mContactData);
- }
-
- /**
- * Setup the layout for the contact without updates.
- * TODO: Clean up this method so it's easier to understand.
- */
- private void showContactWithoutUpdates() {
- if (mContactData == null) {
- return;
- }
-
- Uri previousContactUri = mContactUri;
- mContactUri = mContactData.getLookupUri();
- boolean isDifferentContact = !UriUtils.areEqual(previousContactUri, mContactUri);
-
- switch (mLayoutMode) {
- case LayoutMode.TWO_COLUMN:
- // Show the static photo which is next to the list of scrolling contact details
- mDetailFragment.setShowStaticPhoto(true);
- // Hide the updates fragment
- mUpdatesFragmentView.setVisibility(View.GONE);
- break;
- case LayoutMode.VIEW_PAGER_AND_TAB_CAROUSEL:
- // Hide the tab carousel
- mTabCarousel.setVisibility(View.GONE);
- // Update ViewPager to disable swipe so that it only shows the detail fragment
- // and switch to the detail fragment
- mViewPagerAdapter.enableSwipe(false);
- mViewPager.setCurrentItem(0, false /* smooth transition */);
- break;
- case LayoutMode.FRAGMENT_CAROUSEL:
- // Disable swipe so only the detail fragment shows
- mFragmentCarousel.setCurrentPage(0);
- mFragmentCarousel.enableSwipe(false);
- break;
- case LayoutMode.TWO_COLUMN_FRAGMENT_CAROUSEL:
- mFragmentCarousel.setCurrentPage(0);
- mFragmentCarousel.enableSwipe(false);
- mDetailFragment.setShowStaticPhoto(true);
- break;
- default:
- throw new IllegalStateException("Invalid LayoutMode " + mLayoutMode);
- }
-
- if (isDifferentContact) {
- resetFragments();
- }
-
- mDetailFragment.setData(mContactUri, mContactData);
- }
-
- private void resetTabCarousel() {
- mTabCarousel.reset();
- }
-
- private void resetViewPager() {
- mViewPager.setCurrentItem(0, false /* smooth transition */);
- }
-
- private void resetFragments() {
- mDetailFragment.resetAdapter();
- mUpdatesFragment.resetAdapter();
}
public FragmentKeyListener getCurrentPage() {
- switch (getCurrentPageIndex()) {
- case 0:
- return mDetailFragment;
- case 1:
- return mUpdatesFragment;
- default:
- throw new IllegalStateException("Invalid current item for ViewPager");
- }
- }
-
- private int getCurrentPageIndex() {
- // If the contact has social updates, then retrieve the current page based on the
- // {@link ViewPager} or fragment carousel.
- if (mContactHasUpdates) {
- if (mViewPager != null) {
- return mViewPager.getCurrentItem();
- } else if (mFragmentCarousel != null) {
- return mFragmentCarousel.getCurrentPage();
- }
- }
- // Otherwise return the default page (detail fragment).
- return 0;
+ return mDetailFragment;
}
public void onSaveInstanceState(Bundle outState) {
outState.putParcelable(KEY_CONTACT_URI, mContactUri);
- outState.putBoolean(KEY_CONTACT_HAS_UPDATES, mContactHasUpdates);
- outState.putInt(KEY_CURRENT_PAGE_INDEX, getCurrentPageIndex());
- }
-
- private final OnPageChangeListener mOnPageChangeListener = new OnPageChangeListener() {
-
- private ObjectAnimator mTabCarouselAnimator;
-
- @Override
- public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
- // The user is horizontally dragging the {@link ViewPager}, so send
- // these scroll changes to the tab carousel. Ignore these events though if the carousel
- // is actually controlling the {@link ViewPager} scrolls because it will already be
- // in the correct position.
- if (mViewPager.isFakeDragging()) return;
-
- int x = (int) ((position + positionOffset) *
- mTabCarousel.getAllowedHorizontalScrollLength());
- mTabCarousel.scrollTo(x, 0);
- }
-
- @Override
- public void onPageSelected(int position) {
- // Since the {@link ViewPager} has committed to a new page now (but may not have
- // finished scrolling yet), update the tab selection in the carousel.
- mTabCarousel.setCurrentTab(position);
- }
-
- @Override
- public void onPageScrollStateChanged(int state) {
- if (mViewPagerState == ViewPager.SCROLL_STATE_IDLE) {
-
- // If we are leaving the IDLE state, we are starting a swipe.
- // First cancel any pending animations on the tab carousel.
- cancelTabCarouselAnimator();
-
- // Sync the two lists because the list on the other page will start to show as
- // we swipe over more.
- syncScrollStateBetweenLists(mViewPager.getCurrentItem());
-
- } else if (state == ViewPager.SCROLL_STATE_IDLE) {
-
- // Otherwise if the {@link ViewPager} is idle now, a page has been selected and
- // scrolled into place. Perform an animation of the tab carousel is needed.
- int currentPageIndex = mViewPager.getCurrentItem();
- int tabCarouselOffset = (int) mTabCarousel.getY();
- boolean shouldAnimateTabCarousel;
-
- // Find the offset position of the first item in the list of the current page.
- int listOffset = getOffsetOfFirstItemInList(currentPageIndex);
-
- // If the list was able to successfully offset by the tab carousel amount, then
- // log this as the new Y coordinate for that page, and no animation is needed.
- if (listOffset == tabCarouselOffset) {
- mTabCarousel.storeYCoordinate(currentPageIndex, tabCarouselOffset);
- shouldAnimateTabCarousel = false;
- } else if (listOffset == Integer.MIN_VALUE) {
- // If the offset of the first item in the list is unknown (i.e. the item
- // is no longer visible on screen) then just animate the tab carousel to the
- // previously logged position.
- shouldAnimateTabCarousel = true;
- } else if (Math.abs(listOffset) < Math.abs(tabCarouselOffset)) {
- // If the list could not offset the full amount of the tab carousel offset (i.e.
- // the list can only be scrolled a tiny amount), then animate the carousel down
- // to compensate.
- mTabCarousel.storeYCoordinate(currentPageIndex, listOffset);
- shouldAnimateTabCarousel = true;
- } else {
- // By default, animate back to the Y coordinate of the tab carousel the last
- // time the other page was selected.
- shouldAnimateTabCarousel = true;
- }
-
- if (shouldAnimateTabCarousel) {
- float desiredOffset = mTabCarousel.getStoredYCoordinateForTab(currentPageIndex);
- if (desiredOffset != tabCarouselOffset) {
- createTabCarouselAnimator(desiredOffset);
- mTabCarouselAnimator.start();
- }
- }
- }
- mViewPagerState = state;
- }
-
- private void createTabCarouselAnimator(float desiredValue) {
- mTabCarouselAnimator = ObjectAnimator.ofFloat(
- mTabCarousel, "y", desiredValue).setDuration(75);
- mTabCarouselAnimator.setInterpolator(AnimationUtils.loadInterpolator(
- mActivity, android.R.anim.accelerate_decelerate_interpolator));
- mTabCarouselAnimator.addListener(mTabCarouselAnimatorListener);
- }
-
- private void cancelTabCarouselAnimator() {
- if (mTabCarouselAnimator != null) {
- mTabCarouselAnimator.cancel();
- mTabCarouselAnimator = null;
- mTabCarouselIsAnimating = false;
- }
- }
- };
-
- private void syncScrollStateBetweenLists(int currentPageIndex) {
- // Since the user interacted with the currently visible page, we need to sync the
- // list on the other page (i.e. if the updates page is the current page, modify the
- // list in the details page).
- if (currentPageIndex == TAB_INDEX_UPDATES) {
- mDetailFragment.requestToMoveToOffset((int) mTabCarousel.getY());
- } else {
- mUpdatesFragment.requestToMoveToOffset((int) mTabCarousel.getY());
- }
- }
-
- private int getOffsetOfFirstItemInList(int currentPageIndex) {
- if (currentPageIndex == TAB_INDEX_DETAIL) {
- return mDetailFragment.getFirstListItemOffset();
- } else {
- return mUpdatesFragment.getFirstListItemOffset();
- }
- }
-
- /**
- * This listener keeps track of whether the tab carousel animation is currently going on or not,
- * in order to prevent other simultaneous changes to the Y position of the tab carousel which
- * can cause flicker.
- */
- private final AnimatorListener mTabCarouselAnimatorListener = new AnimatorListener() {
-
- @Override
- public void onAnimationCancel(Animator animation) {
- mTabCarouselIsAnimating = false;
- }
-
- @Override
- public void onAnimationEnd(Animator animation) {
- mTabCarouselIsAnimating = false;
- }
-
- @Override
- public void onAnimationRepeat(Animator animation) {
- mTabCarouselIsAnimating = true;
- }
-
- @Override
- public void onAnimationStart(Animator animation) {
- mTabCarouselIsAnimating = true;
- }
- };
-
- private final ContactDetailTabCarousel.Listener mTabCarouselListener
- = new ContactDetailTabCarousel.Listener() {
-
- @Override
- public void onTouchDown() {
- // The user just started scrolling the carousel, so begin
- // "fake dragging" the {@link ViewPager} if it's not already
- // doing so.
- if (!mViewPager.isFakeDragging()) mViewPager.beginFakeDrag();
- }
-
- @Override
- public void onTouchUp() {
- // The user just stopped scrolling the carousel, so stop
- // "fake dragging" the {@link ViewPager} if it was doing so
- // before.
- if (mViewPager.isFakeDragging()) mViewPager.endFakeDrag();
- }
-
- @Override
- public void onScrollChanged(int l, int t, int oldl, int oldt) {
- // The user is scrolling the carousel, so send the scroll
- // deltas to the {@link ViewPager} so it can move in sync.
- if (mViewPager.isFakeDragging()) {
- mViewPager.fakeDragBy(oldl - l);
- }
- }
-
- @Override
- public void onTabSelected(int position) {
- // The user selected a tab, so update the {@link ViewPager}
- mViewPager.setCurrentItem(position);
- }
- };
-
- private final class VerticalScrollListener implements OnScrollListener {
-
- private final int mPageIndex;
-
- public VerticalScrollListener(int pageIndex) {
- mPageIndex = pageIndex;
- }
-
- @Override
- public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount,
- int totalItemCount) {
- int currentPageIndex = mViewPager.getCurrentItem();
- // Don't move the carousel if: 1) the contact does not have social updates because then
- // tab carousel must not be visible, 2) if the view pager is still being scrolled,
- // 3) if the current page being viewed is not this one, or 4) if the tab carousel
- // is already being animated vertically.
- if (!mContactHasUpdates || mViewPagerState != ViewPager.SCROLL_STATE_IDLE ||
- mPageIndex != currentPageIndex || mTabCarouselIsAnimating) {
- return;
- }
- // If the FIRST item is not visible on the screen, then the carousel must be pinned
- // at the top of the screen.
- if (firstVisibleItem != 0) {
- mTabCarousel.moveToYCoordinate(mPageIndex,
- -mTabCarousel.getAllowedVerticalScrollLength());
- return;
- }
- View topView = view.getChildAt(firstVisibleItem);
- if (topView == null) {
- return;
- }
- int amtToScroll = Math.max((int) view.getChildAt(firstVisibleItem).getY(),
- -mTabCarousel.getAllowedVerticalScrollLength());
- mTabCarousel.moveToYCoordinate(mPageIndex, amtToScroll);
- }
-
- @Override
- public void onScrollStateChanged(AbsListView view, int scrollState) {
- // Once the list has become IDLE, check if we need to sync the scroll position of
- // the other list now. This will make swiping faster by doing the re-layout now
- // (instead of at the start of a swipe). However, there will still be another check
- // when we start swiping if the scroll positions are correct (to catch the edge case
- // where the user flings and immediately starts a swipe so we never get the idle state).
- if (scrollState == SCROLL_STATE_IDLE) {
- syncScrollStateBetweenLists(mPageIndex);
- }
- }
}
}
diff --git a/src/com/android/contacts/detail/ContactDetailTabCarousel.java b/src/com/android/contacts/detail/ContactDetailTabCarousel.java
deleted file mode 100644
index 25bcac6..0000000
--- a/src/com/android/contacts/detail/ContactDetailTabCarousel.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * 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.content.Context;
-import android.content.res.Resources;
-import android.util.AttributeSet;
-import android.util.Log;
-import android.util.TypedValue;
-import android.view.MotionEvent;
-import android.view.View;
-import android.view.View.OnTouchListener;
-import android.view.ViewPropertyAnimator;
-import android.widget.HorizontalScrollView;
-import android.widget.ImageView;
-import android.widget.TextView;
-
-import com.android.contacts.R;
-import com.android.contacts.common.model.Contact;
-import com.android.contacts.util.MoreMath;
-import com.android.contacts.util.SchedulingUtils;
-
-/**
- * This is a horizontally scrolling carousel with 2 tabs: one to see info about the contact and
- * one to see updates from the contact.
- */
-public class ContactDetailTabCarousel extends HorizontalScrollView implements OnTouchListener {
-
- private static final String TAG = ContactDetailTabCarousel.class.getSimpleName();
-
- private static final int TRANSITION_TIME = 200;
- private static final int TRANSITION_MOVE_IN_TIME = 150;
-
- private static final int TAB_INDEX_ABOUT = 0;
- private static final int TAB_INDEX_UPDATES = 1;
- private static final int TAB_COUNT = 2;
-
- /** Tab width as defined as a fraction of the screen width */
- private float mTabWidthScreenWidthFraction;
-
- /** Tab height as defined as a fraction of the screen width */
- private float mTabHeightScreenWidthFraction;
-
- /** Height in pixels of the shadow under the tab carousel */
- private int mTabShadowHeight;
-
- private ImageView mPhotoView;
- private View mPhotoViewOverlay;
- private TextView mStatusView;
- private ImageView mStatusPhotoView;
- private final ContactDetailPhotoSetter mPhotoSetter = new ContactDetailPhotoSetter();
-
- private Listener mListener;
-
- private int mCurrentTab = TAB_INDEX_ABOUT;
-
- private View mTabAndShadowContainer;
- private View mShadow;
- private CarouselTab mAboutTab;
- private View mTabDivider;
- private CarouselTab mUpdatesTab;
-
- /** Last Y coordinate of the carousel when the tab at the given index was selected */
- private final float[] mYCoordinateArray = new float[TAB_COUNT];
-
- private int mTabDisplayLabelHeight;
-
- private boolean mScrollToCurrentTab = false;
- private int mLastScrollPosition = Integer.MIN_VALUE;
- private int mAllowedHorizontalScrollLength = Integer.MIN_VALUE;
- private int mAllowedVerticalScrollLength = Integer.MIN_VALUE;
-
- /** Factor to scale scroll-amount sent to listeners. */
- private float mScrollScaleFactor = 1.0f;
-
- private static final float MAX_ALPHA = 0.5f;
-
- /**
- * Interface for callbacks invoked when the user interacts with the carousel.
- */
- public interface Listener {
- public void onTouchDown();
- public void onTouchUp();
-
- public void onScrollChanged(int l, int t, int oldl, int oldt);
- public void onTabSelected(int position);
- }
-
- public ContactDetailTabCarousel(Context context, AttributeSet attrs) {
- super(context, attrs);
-
- setOnTouchListener(this);
-
- Resources resources = mContext.getResources();
- mTabDisplayLabelHeight = resources.getDimensionPixelSize(
- R.dimen.detail_tab_carousel_tab_label_height);
- mTabShadowHeight = resources.getDimensionPixelSize(
- R.dimen.detail_contact_photo_shadow_height);
- mTabWidthScreenWidthFraction = resources.getFraction(
- R.fraction.tab_width_screen_width_percentage, 1, 1);
- mTabHeightScreenWidthFraction = resources.getFraction(
- R.fraction.tab_height_screen_width_percentage, 1, 1);
- }
-
- @Override
- protected void onFinishInflate() {
- super.onFinishInflate();
- mTabAndShadowContainer = findViewById(R.id.tab_and_shadow_container);
- mAboutTab = (CarouselTab) findViewById(R.id.tab_about);
- mAboutTab.setLabel(mContext.getString(R.string.contactDetailAbout));
- mAboutTab.setOverlayOnClickListener(mAboutTabTouchInterceptListener);
-
- mTabDivider = findViewById(R.id.tab_divider);
-
- mUpdatesTab = (CarouselTab) findViewById(R.id.tab_update);
- mUpdatesTab.setLabel(mContext.getString(R.string.contactDetailUpdates));
- mUpdatesTab.setOverlayOnClickListener(mUpdatesTabTouchInterceptListener);
-
- mShadow = findViewById(R.id.shadow);
-
- // Retrieve the photo view for the "about" tab
- // TODO: This should be moved down to mAboutTab, so that it hosts its own controls
- mPhotoView = (ImageView) mAboutTab.findViewById(R.id.photo);
- mPhotoViewOverlay = mAboutTab.findViewById(R.id.photo_overlay);
-
- // Retrieve the social update views for the "updates" tab
- // TODO: This should be moved down to mUpdatesTab, so that it hosts its own controls
- mStatusView = (TextView) mUpdatesTab.findViewById(R.id.status);
- mStatusPhotoView = (ImageView) mUpdatesTab.findViewById(R.id.status_photo);
-
- // Workaround for framework issue... it shouldn't be necessary to have a
- // clickable object in the hierarchy, but if not the horizontal scroll
- // behavior doesn't work. Note: the "About" tab doesn't need this
- // because we set a real click-handler elsewhere.
- mStatusView.setClickable(true);
- mStatusPhotoView.setClickable(true);
- }
-
- @Override
- protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
- int screenWidth = MeasureSpec.getSize(widthMeasureSpec);
- // Compute the width of a tab as a fraction of the screen width
- int tabWidth = Math.round(mTabWidthScreenWidthFraction * screenWidth);
-
- // Find the allowed scrolling length by subtracting the current visible screen width
- // from the total length of the tabs.
- mAllowedHorizontalScrollLength = tabWidth * TAB_COUNT - screenWidth;
-
- // Scrolling by mAllowedHorizontalScrollLength causes listeners to
- // scroll by the entire screen amount; compute the scale-factor
- // necessary to make this so.
- if (mAllowedHorizontalScrollLength == 0) {
- // Guard against divide-by-zero.
- // Note: this hard-coded value prevents a crash, but won't result in the
- // desired scrolling behavior. We rely on the framework calling onMeasure()
- // again with a non-zero screen width.
- mScrollScaleFactor = 1.0f;
- Log.w(TAG, "set scale-factor to 1.0 to avoid divide-by-zero");
- } else {
- mScrollScaleFactor = screenWidth / mAllowedHorizontalScrollLength;
- }
-
- int tabHeight = Math.round(screenWidth * mTabHeightScreenWidthFraction) + mTabShadowHeight;
- // Set the child {@link LinearLayout} to be TAB_COUNT * the computed tab width so that the
- // {@link LinearLayout}'s children (which are the tabs) will evenly split that width.
- if (getChildCount() > 0) {
- View child = getChildAt(0);
-
- // add 1 dip of separation between the tabs
- final int seperatorPixels =
- (int)(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1,
- getResources().getDisplayMetrics()) + 0.5f);
-
- child.measure(
- MeasureSpec.makeMeasureSpec(
- TAB_COUNT * tabWidth +
- (TAB_COUNT - 1) * seperatorPixels, MeasureSpec.EXACTLY),
- MeasureSpec.makeMeasureSpec(tabHeight, MeasureSpec.EXACTLY));
- }
-
- mAllowedVerticalScrollLength = tabHeight - mTabDisplayLabelHeight - mTabShadowHeight;
- setMeasuredDimension(
- resolveSize(screenWidth, widthMeasureSpec),
- resolveSize(tabHeight, heightMeasureSpec));
- }
-
- @Override
- protected void onLayout(boolean changed, int l, int t, int r, int b) {
- super.onLayout(changed, l, t, r, b);
-
- // Defer this stuff until after the layout has finished. This is because
- // updateAlphaLayers() ultimately results in another layout request, and
- // the framework currently can't handle this safely.
- if (!mScrollToCurrentTab) return;
- mScrollToCurrentTab = false;
- SchedulingUtils.doAfterLayout(this, new Runnable() {
- @Override
- public void run() {
- scrollTo(mCurrentTab == TAB_INDEX_ABOUT ? 0 : mAllowedHorizontalScrollLength, 0);
- updateAlphaLayers();
- }
- });
- }
-
- /** When clicked, selects the corresponding tab. */
- private class TabClickListener implements OnClickListener {
- private final int mTab;
-
- public TabClickListener(int tab) {
- super();
- mTab = tab;
- }
-
- @Override
- public void onClick(View v) {
- mListener.onTabSelected(mTab);
- }
- }
-
- private final TabClickListener mAboutTabTouchInterceptListener =
- new TabClickListener(TAB_INDEX_ABOUT);
-
- private final TabClickListener mUpdatesTabTouchInterceptListener =
- new TabClickListener(TAB_INDEX_UPDATES);
-
- /**
- * Does in "appear" animation to allow a seamless transition from
- * the "No updates" mode.
- * @param width Width of the container. As we haven't been layed out yet, we can't know
- * @param scrollOffset The offset by how far we scrolled, where 0=not scrolled, -x=scrolled by
- * x pixels, Integer.MIN_VALUE=scrolled so far that the image is not visible in "no updates"
- * mode of this screen
- */
- public void animateAppear(int width, int scrollOffset) {
- final float photoHeight = mTabHeightScreenWidthFraction * width;
- final boolean animateZoomAndFade;
- int pixelsToScrollVertically = 0;
-
- // Depending on how far we are scrolled down, there is one of three animations:
- // - Zoom and fade the picture (if it is still visible)
- // - Scroll, zoom and fade (if the picture is mostly invisible and we now have a
- // bigger visible region due to the pinning)
- // - Just scroll if the picture is completely invisible. This time, no zoom is needed
- if (scrollOffset == Integer.MIN_VALUE) {
- // animate in completely by scrolling. no need for zooming here
- pixelsToScrollVertically = mTabDisplayLabelHeight;
- animateZoomAndFade = false;
- } else {
- final int pixelsOfPhotoLeft = Math.round(photoHeight) + scrollOffset;
- if (pixelsOfPhotoLeft > mTabDisplayLabelHeight) {
- // nothing to scroll
- pixelsToScrollVertically = 0;
- } else {
- pixelsToScrollVertically = mTabDisplayLabelHeight - pixelsOfPhotoLeft;
- }
- animateZoomAndFade = true;
- }
-
- if (pixelsToScrollVertically != 0) {
- // We can't animate ourselves here, because our own translation is needed for the user's
- // scrolling. Instead, we use our only child. As we are transparent, that is just as
- // good
- mTabAndShadowContainer.setTranslationY(-pixelsToScrollVertically);
- final ViewPropertyAnimator animator = mTabAndShadowContainer.animate();
- animator.translationY(0.0f);
- animator.setDuration(TRANSITION_MOVE_IN_TIME);
- }
-
- if (animateZoomAndFade) {
- // Hack: We have two types of possible layouts:
- // If the picture is square, it is square in both "with updates" and "without updates"
- // --> no need for scale animation here
- // example: 10inch tablet portrait
- // If the picture is non-square, it is full-width in "without updates" and something
- // arbitrary in "with updates"
- // --> do animation with container
- // example: 4.6inch phone portrait
- final boolean squarePicture =
- mTabWidthScreenWidthFraction == mTabHeightScreenWidthFraction;
- final int firstTransitionTime;
- if (squarePicture) {
- firstTransitionTime = 0;
- } else {
- // For x, we need to scale our container so we'll animate the whole tab
- // (unfortunately, we need to have the text invisible during this transition as it
- // would also be stretched)
- float revScale = 1.0f/mTabWidthScreenWidthFraction;
- mAboutTab.setScaleX(revScale);
- mAboutTab.setPivotX(0.0f);
- final ViewPropertyAnimator aboutAnimator = mAboutTab.animate();
- aboutAnimator.setDuration(TRANSITION_TIME);
- aboutAnimator.scaleX(1.0f);
-
- // For y, we need to scale only the picture itself because we want it to be cropped
- mPhotoView.setScaleY(revScale);
- mPhotoView.setPivotY(photoHeight * 0.5f);
- final ViewPropertyAnimator photoAnimator = mPhotoView.animate();
- photoAnimator.setDuration(TRANSITION_TIME);
- photoAnimator.scaleY(1.0f);
- firstTransitionTime = TRANSITION_TIME;
- }
-
- // Animate in the labels after the above transition is finished
- mAboutTab.fadeInLabelViewAnimator(firstTransitionTime, true);
- mUpdatesTab.fadeInLabelViewAnimator(firstTransitionTime, false);
-
- final float pixelsToTranslate = (1.0f - mTabWidthScreenWidthFraction) * width;
- // Views to translate
- for (View view : new View[] { mUpdatesTab, mTabDivider }) {
- view.setTranslationX(pixelsToTranslate);
- final ViewPropertyAnimator translateAnimator = view.animate();
- translateAnimator.translationX(0.0f);
- translateAnimator.setDuration(TRANSITION_TIME);
- }
-
- // Another hack: If the picture is square, there is no shadow in "Without updates"
- // --> fade it in after the translations are done
- if (squarePicture) {
- mShadow.setAlpha(0.0f);
- mShadow.animate().setStartDelay(TRANSITION_TIME).alpha(1.0f);
- }
- }
- }
-
- private void updateAlphaLayers() {
- float alpha = mLastScrollPosition * MAX_ALPHA / mAllowedHorizontalScrollLength;
- alpha = MoreMath.clamp(alpha, 0.0f, 1.0f);
- mAboutTab.setAlphaLayerValue(alpha);
- mUpdatesTab.setAlphaLayerValue(MAX_ALPHA - alpha);
- }
-
- @Override
- protected void onScrollChanged(int x, int y, int oldX, int oldY) {
- super.onScrollChanged(x, y, oldX, oldY);
-
- // Guard against framework issue where onScrollChanged() is called twice
- // for each touch-move event. This wreaked havoc on the tab-carousel: the
- // view-pager moved twice as fast as it should because we called fakeDragBy()
- // twice with the same value.
- if (mLastScrollPosition == x) return;
-
- // Since we never completely scroll the about/updates tabs off-screen,
- // the draggable range is less than the width of the carousel. Our
- // listeners don't care about this... if we scroll 75% percent of our
- // draggable range, they want to scroll 75% of the entire carousel
- // width, not the same number of pixels that we scrolled.
- int scaledL = (int) (x * mScrollScaleFactor);
- int oldScaledL = (int) (oldX * mScrollScaleFactor);
- mListener.onScrollChanged(scaledL, y, oldScaledL, oldY);
-
- mLastScrollPosition = x;
- updateAlphaLayers();
- }
-
- /**
- * Reset the carousel to the start position (i.e. because new data will be loaded in for a
- * different contact).
- */
- public void reset() {
- scrollTo(0, 0);
- setCurrentTab(0);
- moveToYCoordinate(0, 0);
- }
-
- /**
- * Set the current tab that should be restored when the view is first laid out.
- */
- public void restoreCurrentTab(int position) {
- setCurrentTab(position);
- // It is only possible to scroll the view after onMeasure() has been called (where the
- // allowed horizontal scroll length is determined). Hence, set a flag that will be read
- // in onLayout() after the children and this view have finished being laid out.
- mScrollToCurrentTab = true;
- }
-
- /**
- * Restore the Y position of this view to the last manually requested value. This can be done
- * after the parent has been re-laid out again, where this view's position could have been
- * lost if the view laid outside its parent's bounds.
- */
- public void restoreYCoordinate() {
- setY(getStoredYCoordinateForTab(mCurrentTab));
- }
-
- /**
- * Request that the view move to the given Y coordinate. Also store the Y coordinate as the
- * last requested Y coordinate for the given tabIndex.
- */
- public void moveToYCoordinate(int tabIndex, float y) {
- setY(y);
- storeYCoordinate(tabIndex, y);
- }
-
- /**
- * Store this information as the last requested Y coordinate for the given tabIndex.
- */
- public void storeYCoordinate(int tabIndex, float y) {
- mYCoordinateArray[tabIndex] = y;
- }
-
- /**
- * Returns the stored Y coordinate of this view the last time the user was on the selected
- * tab given by tabIndex.
- */
- public float getStoredYCoordinateForTab(int tabIndex) {
- return mYCoordinateArray[tabIndex];
- }
-
- /**
- * Returns the number of pixels that this view can be scrolled horizontally.
- */
- public int getAllowedHorizontalScrollLength() {
- return mAllowedHorizontalScrollLength;
- }
-
- /**
- * Returns the number of pixels that this view can be scrolled vertically while still allowing
- * the tab labels to still show.
- */
- public int getAllowedVerticalScrollLength() {
- return mAllowedVerticalScrollLength;
- }
-
- /**
- * Updates the tab selection.
- */
- public void setCurrentTab(int position) {
- final CarouselTab selected, deselected;
-
- switch (position) {
- case TAB_INDEX_ABOUT:
- selected = mAboutTab;
- deselected = mUpdatesTab;
- break;
- case TAB_INDEX_UPDATES:
- selected = mUpdatesTab;
- deselected = mAboutTab;
- break;
- default:
- throw new IllegalStateException("Invalid tab position " + position);
- }
- selected.showSelectedState();
- selected.setOverlayClickable(false);
- deselected.showDeselectedState();
- deselected.setOverlayClickable(true);
- mCurrentTab = position;
- }
-
- /**
- * Loads the data from the Loader-Result. This is the only function that has to be called
- * from the outside to fully setup the View
- */
- public void loadData(Contact contactData) {
- if (contactData == null) return;
-
- // TODO: Move this into the {@link CarouselTab} class when the updates
- // fragment code is more finalized.
- final boolean expandOnClick = contactData.getPhotoUri() != null;
- final OnClickListener listener = mPhotoSetter.setupContactPhotoForClick(
- mContext, contactData, mPhotoView, expandOnClick);
-
- if (expandOnClick || contactData.isWritableContact(mContext)) {
- mPhotoViewOverlay.setOnClickListener(listener);
- } else {
- // Work around framework issue... if we instead use
- // setClickable(false), then we can't swipe horizontally.
- mPhotoViewOverlay.setOnClickListener(null);
- }
-
- ContactDetailDisplayUtils.setSocialSnippet(
- mContext, contactData, mStatusView, mStatusPhotoView);
- }
-
- /**
- * Set the given {@link Listener} to handle carousel events.
- */
- public void setListener(Listener listener) {
- mListener = listener;
- }
-
- @Override
- public boolean onTouch(View v, MotionEvent event) {
- switch (event.getAction()) {
- case MotionEvent.ACTION_DOWN:
- mListener.onTouchDown();
- return true;
- case MotionEvent.ACTION_UP:
- mListener.onTouchUp();
- return true;
- }
- return super.onTouchEvent(event);
- }
-
- @Override
- public boolean onInterceptTouchEvent(MotionEvent ev) {
- boolean interceptTouch = super.onInterceptTouchEvent(ev);
- if (interceptTouch) {
- mListener.onTouchDown();
- }
- return interceptTouch;
- }
-}
diff --git a/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java b/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java
deleted file mode 100644
index 71186fe..0000000
--- a/src/com/android/contacts/detail/ContactDetailUpdatesFragment.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * 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.app.ListFragment;
-import android.content.ContentUris;
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.ContactsContract.StreamItems;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.AbsListView.OnScrollListener;
-import android.widget.ListView;
-
-import com.android.contacts.R;
-import com.android.contacts.activities.ContactDetailActivity.FragmentKeyListener;
-import com.android.contacts.detail.ContactDetailDisplayUtils.StreamPhotoTag;
-import com.android.contacts.util.StreamItemEntry;
-import com.android.contacts.common.model.AccountTypeManager;
-import com.android.contacts.common.model.Contact;
-import com.android.contacts.common.model.account.AccountType;
-
-public class ContactDetailUpdatesFragment extends ListFragment implements FragmentKeyListener {
-
- private static final String TAG = "ContactDetailUpdatesFragment";
-
- private Contact mContactData;
- private Uri mLookupUri;
-
- private LayoutInflater mInflater;
- private StreamItemAdapter mStreamItemAdapter;
-
- private OnScrollListener mVerticalScrollListener;
-
- /**
- * Listener on clicks on a stream item.
- * <p>
- * It assumes the view has a tag of type {@link StreamItemEntry} associated with it.
- */
- private final View.OnClickListener mStreamItemClickListener = new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- StreamItemEntry streamItemEntry = (StreamItemEntry) view.getTag();
- if (streamItemEntry == null) {
- // Ignore if this item does not have a stream item associated with it.
- return;
- }
- final AccountType accountType = getAccountTypeForStreamItemEntry(streamItemEntry);
-
- final Uri uri = ContentUris.withAppendedId(StreamItems.CONTENT_URI,
- streamItemEntry.getId());
- final Intent intent = new Intent(Intent.ACTION_VIEW, uri);
- intent.setClassName(accountType.syncAdapterPackageName,
- accountType.getViewStreamItemActivity());
- startActivity(intent);
- }
- };
-
- private final View.OnClickListener mStreamItemPhotoItemClickListener
- = new View.OnClickListener() {
- @Override
- public void onClick(View view) {
- StreamPhotoTag tag = (StreamPhotoTag) view.getTag();
- if (tag == null) {
- return;
- }
- final AccountType accountType = getAccountTypeForStreamItemEntry(tag.streamItem);
-
- final Intent intent = new Intent(Intent.ACTION_VIEW, tag.getStreamItemPhotoUri());
- intent.setClassName(accountType.syncAdapterPackageName,
- accountType.getViewStreamItemPhotoActivity());
- startActivity(intent);
- }
- };
-
- private AccountType getAccountTypeForStreamItemEntry(StreamItemEntry streamItemEntry) {
- return AccountTypeManager.getInstance(getActivity()).getAccountType(
- streamItemEntry.getAccountType(), streamItemEntry.getDataSet());
- }
-
- public ContactDetailUpdatesFragment() {
- // Explicit constructor for inflation
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
- mInflater = inflater;
- return mInflater.inflate(R.layout.contact_detail_updates_fragment, container, false);
- }
-
- @Override
- public void onViewCreated(View view, Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
- mStreamItemAdapter = new StreamItemAdapter(getActivity(), mStreamItemClickListener,
- mStreamItemPhotoItemClickListener);
- setListAdapter(mStreamItemAdapter);
- getListView().setOnScrollListener(mVerticalScrollListener);
- }
-
- public void setData(Uri lookupUri, Contact result) {
- if (result == null) {
- return;
- }
- mLookupUri = lookupUri;
- mContactData = result;
- }
-
- /**
- * Reset the list adapter in this {@link Fragment} to get rid of any saved scroll position
- * from a previous contact.
- */
- public void resetAdapter() {
- setListAdapter(mStreamItemAdapter);
- }
-
- @Override
- public boolean handleKeyDown(int keyCode) {
- return false;
- }
-
- public void setVerticalScrollListener(OnScrollListener listener) {
- mVerticalScrollListener = listener;
- }
-
- /**
- * Returns the top coordinate of the first item in the {@link ListView}. If the first item
- * in the {@link ListView} is not visible or there are no children in the list, then return
- * Integer.MIN_VALUE. Note that the returned value will be <= 0 because the first item in the
- * list cannot have a positive offset.
- */
- public int getFirstListItemOffset() {
- return ContactDetailDisplayUtils.getFirstListItemOffset(getListView());
- }
-
- /**
- * Tries to scroll the first item to the given offset (this can be a no-op if the list is
- * already in the correct position).
- * @param offset which should be <= 0
- */
- public void requestToMoveToOffset(int offset) {
- ContactDetailDisplayUtils.requestToMoveToOffset(getListView(), offset);
- }
-}
diff --git a/src/com/android/contacts/detail/ContactDetailViewPagerAdapter.java b/src/com/android/contacts/detail/ContactDetailViewPagerAdapter.java
deleted file mode 100644
index 4213490..0000000
--- a/src/com/android/contacts/detail/ContactDetailViewPagerAdapter.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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.os.Parcelable;
-import android.support.v4.view.PagerAdapter;
-import android.support.v4.view.ViewPager;
-import android.view.View;
-import android.view.ViewGroup;
-
-/**
- * Adapter for the {@link ViewPager} for the contact detail page for a contact in 2 cases:
- * 1) without social updates, and 2) with social updates. The default initial case is for
- * the contact with social updates which uses all possible pages.
- */
-public class ContactDetailViewPagerAdapter extends PagerAdapter {
-
- public static final String ABOUT_FRAGMENT_TAG = "view-pager-about-fragment";
- public static final String UPDATES_FRAGMENT_TAG = "view-pager-updates-fragment";
-
- private static final int INDEX_ABOUT_FRAGMENT = 0;
- private static final int INDEX_UPDATES_FRAGMENT = 1;
-
- private static final int MAX_FRAGMENT_VIEW_COUNT = 2;
-
- /**
- * The initial value for the view count needs to be MAX_FRAGMENT_VIEW_COUNT,
- * otherwise anything smaller would break screen rotation functionality for a user viewing
- * a contact with social updates (i.e. the user was viewing the second page, rotates the
- * device, the view pager requires the second page to exist immediately on launch).
- */
- private int mFragmentViewCount = MAX_FRAGMENT_VIEW_COUNT;
-
- private View mAboutFragmentView;
- private View mUpdatesFragmentView;
-
- public ContactDetailViewPagerAdapter() {
- }
-
- public void setAboutFragmentView(View view) {
- mAboutFragmentView = view;
- }
-
- public void setUpdatesFragmentView(View view) {
- mUpdatesFragmentView = view;
- }
-
- /**
- * Enable swiping if the detail and update fragments should be showing. Otherwise diable
- * swiping if only the detail fragment should be showing.
- */
- public void enableSwipe(boolean enable) {
- mFragmentViewCount = enable ? MAX_FRAGMENT_VIEW_COUNT : 1;
- notifyDataSetChanged();
- }
-
- @Override
- public int getCount() {
- return mFragmentViewCount;
- }
-
- /** Gets called when the number of items changes. */
- @Override
- public int getItemPosition(Object object) {
- // Always return a valid index for the about fragment view because it's always shown
- // whether the contact has social updates or not.
- if (object == mAboutFragmentView) {
- return INDEX_ABOUT_FRAGMENT;
- }
- // Only return a valid index for the updates fragment view if our view count > 1.
- if (object == mUpdatesFragmentView && mFragmentViewCount > 1) {
- return INDEX_UPDATES_FRAGMENT;
- }
- // Otherwise the view should have no position.
- return POSITION_NONE;
- }
-
- @Override
- public void startUpdate(ViewGroup container) {
- }
-
- @Override
- public Object instantiateItem(ViewGroup container, int position) {
- switch (position) {
- case INDEX_ABOUT_FRAGMENT:
- mAboutFragmentView.setVisibility(View.VISIBLE);
- return mAboutFragmentView;
- case INDEX_UPDATES_FRAGMENT:
- mUpdatesFragmentView.setVisibility(View.VISIBLE);
- return mUpdatesFragmentView;
- }
- throw new IllegalArgumentException("Invalid position: " + position);
- }
-
- @Override
- public void destroyItem(ViewGroup container, int position, Object object) {
- ((View) object).setVisibility(View.GONE);
- }
-
- @Override
- public void finishUpdate(ViewGroup container) {
- }
-
- @Override
- public boolean isViewFromObject(View view, Object object) {
- return ((View) object) == view;
- }
-
- @Override
- public Parcelable saveState() {
- return null;
- }
-
- @Override
- public void restoreState(Parcelable state, ClassLoader loader) {
- }
-}
diff --git a/src/com/android/contacts/detail/StreamItemAdapter.java b/src/com/android/contacts/detail/StreamItemAdapter.java
deleted file mode 100644
index 6e1adc5..0000000
--- a/src/com/android/contacts/detail/StreamItemAdapter.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * 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.content.Context;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.BaseAdapter;
-
-import com.android.contacts.R;
-import com.android.contacts.common.model.AccountTypeManager;
-import com.android.contacts.common.model.account.AccountType;
-import com.android.contacts.util.StreamItemEntry;
-
-import com.google.common.collect.Lists;
-
-import java.util.List;
-
-/**
- * List adapter for stream items of a given contact.
- */
-public class StreamItemAdapter extends BaseAdapter {
- /** The header view, hidden under the tab carousel, if present. */
- private static final int ITEM_VIEW_TYPE_HEADER = 0;
- /** The updates in the list. */
- private static final int ITEM_VIEW_TYPE_STREAM_ITEM = 1;
-
- private final Context mContext;
- private final View.OnClickListener mItemClickListener;
- private final View.OnClickListener mPhotoClickListener;
- private final LayoutInflater mInflater;
-
- private List<StreamItemEntry> mStreamItems;
-
- public StreamItemAdapter(Context context, View.OnClickListener itemClickListener,
- View.OnClickListener photoClickListener) {
- mContext = context;
- mItemClickListener = itemClickListener;
- mPhotoClickListener = photoClickListener;
- mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- mStreamItems = Lists.newArrayList();
- }
-
- @Override
- public int getCount() {
- // The header should only be included as items in the list if there are other
- // stream items.
- int count = mStreamItems.size();
- return (count == 0) ? 0 : (count + 1);
- }
-
- @Override
- public Object getItem(int position) {
- if (position == 0) {
- return null;
- }
- return mStreamItems.get(position - 1);
- }
-
- @Override
- public long getItemId(int position) {
- if (position == 0) {
- return -1;
- }
- return position - 1;
- }
-
- @Override
- public boolean isEnabled(int position) {
- // Make all list items disabled, so they're not clickable.
- // We make child views clickable in getvView() if the account type supports
- // viewStreamItemActivity or viewStreamItemPhotoActivity.
- return false;
- }
-
- @Override
- public boolean areAllItemsEnabled() {
- // See isEnabled().
- return false;
- }
-
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- if (position == 0) {
- return mInflater.inflate(R.layout.updates_header_contact, null);
- }
- final StreamItemEntry streamItem = (StreamItemEntry) getItem(position);
- final AccountTypeManager manager = AccountTypeManager.getInstance(mContext);
- final AccountType accountType =
- manager.getAccountType(streamItem.getAccountType(), streamItem.getDataSet());
-
- final View view = ContactDetailDisplayUtils.createStreamItemView(
- mInflater, mContext, convertView, streamItem,
- // Only pass the photo click listener if the account type has the photo
- // view activity.
- (accountType.getViewStreamItemPhotoActivity() == null) ? null : mPhotoClickListener
- );
- final View contentView = view.findViewById(R.id.stream_item_content);
-
- // If the account type has the stream item view activity, make the stream container
- // clickable.
- if (accountType.getViewStreamItemActivity() != null) {
- contentView.setTag(streamItem);
- contentView.setFocusable(true);
- contentView.setOnClickListener(mItemClickListener);
- contentView.setEnabled(true);
- } else {
- contentView.setTag(null);
- contentView.setFocusable(false);
- contentView.setOnClickListener(null);
- // setOnClickListener makes it clickable, so we need to overwrite it.
- contentView.setClickable(false);
- contentView.setEnabled(false);
- }
- return view;
- }
-
- @Override
- public int getViewTypeCount() {
- // ITEM_VIEW_TYPE_HEADER and ITEM_VIEW_TYPE_STREAM_ITEM
- return 2;
- }
-
- @Override
- public int getItemViewType(int position) {
- if (position == 0) {
- return ITEM_VIEW_TYPE_HEADER;
- }
- return ITEM_VIEW_TYPE_STREAM_ITEM;
- }
-
- public void setStreamItems(List<StreamItemEntry> streamItems) {
- mStreamItems = streamItems;
- notifyDataSetChanged();
- }
-}
diff --git a/src/com/android/contacts/interactions/TestLoaderManager.java b/src/com/android/contacts/interactions/TestLoaderManager.java
index fb6a49b..a85bf8f 100644
--- a/src/com/android/contacts/interactions/TestLoaderManager.java
+++ b/src/com/android/contacts/interactions/TestLoaderManager.java
@@ -93,6 +93,7 @@
private LoaderManager mDelegate;
+ @VisibleForTesting
public TestLoaderManager() {
mFinishedLoaders = new HashSet<Integer>();
}
diff --git a/src/com/android/contacts/util/ContactBadgeUtil.java b/src/com/android/contacts/util/ContactBadgeUtil.java
deleted file mode 100644
index 82a6820..0000000
--- a/src/com/android/contacts/util/ContactBadgeUtil.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.
- */
-
-package com.android.contacts.util;
-
-import android.content.Context;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.text.TextUtils;
-import android.text.format.DateUtils;
-import android.util.Log;
-
-import com.android.contacts.common.ContactPhotoManager;
-import com.android.contacts.util.StreamItemEntry;
-import com.android.contacts.R;
-
-/**
- * Provides static functions to extract summary information for aggregate contacts
- */
-public class ContactBadgeUtil {
- private static final String TAG = "ContactBadgeUtil";
-
- /**
- * Returns the social snippet attribution for the given stream item entry, including the date.
- */
- public static CharSequence getSocialDate(StreamItemEntry streamItem, Context context) {
- final CharSequence timestampDisplayValue;
- final Long statusTimestamp = streamItem.getTimestamp();
- if (statusTimestamp != null) {
- // Set the date/time field by mixing relative and absolute
- // times.
- int flags = DateUtils.FORMAT_ABBREV_RELATIVE;
-
- timestampDisplayValue = DateUtils.getRelativeTimeSpanString(
- statusTimestamp.longValue(), System.currentTimeMillis(),
- DateUtils.MINUTE_IN_MILLIS, flags);
- } else {
- timestampDisplayValue = null;
- }
-
-
- String labelDisplayValue = null;
-
- final String statusLabelRes = streamItem.getLabelRes();
- final String statusResPackage = streamItem.getResPackage();
-
- // Package name used for resources.getIdentifier()
- String identiferPackage = statusResPackage;
- if (statusLabelRes != null) {
- Resources resources;
- if (TextUtils.isEmpty(statusResPackage)) {
- resources = context.getResources();
- // In this case, we're using the framework resources.
- identiferPackage = "android";
- } else {
- PackageManager pm = context.getPackageManager();
- try {
- resources = pm.getResourcesForApplication(statusResPackage);
- } catch (NameNotFoundException e) {
- Log.w(TAG, "Contact status update resource package not found: "
- + statusResPackage);
- resources = null;
- }
- }
-
- if (resources != null) {
- final int resId = resources.getIdentifier(statusLabelRes, "string",
- identiferPackage);
- if (resId == 0) {
- Log.w(TAG, "Contact status update resource not found: " + statusLabelRes +
- " in " + statusResPackage);
- } else {
- labelDisplayValue = resources.getString(resId);
- }
- }
- }
-
- final CharSequence attribution;
- if (timestampDisplayValue != null && labelDisplayValue != null) {
- attribution = context.getString(
- R.string.contact_status_update_attribution_with_date,
- timestampDisplayValue, labelDisplayValue);
- } else if (timestampDisplayValue == null && labelDisplayValue != null) {
- attribution = context.getString(
- R.string.contact_status_update_attribution,
- labelDisplayValue);
- } else if (timestampDisplayValue != null) {
- attribution = timestampDisplayValue;
- } else {
- attribution = null;
- }
- return attribution;
- }
-
- public static Bitmap loadDefaultAvatarPhoto(Context context, boolean hires, boolean darkTheme) {
- return BitmapFactory.decodeResource(context.getResources(),
- ContactPhotoManager.getDefaultAvatarResId(hires, darkTheme));
- }
-}
diff --git a/src/com/android/contacts/util/HtmlUtils.java b/src/com/android/contacts/util/HtmlUtils.java
deleted file mode 100644
index edcda13..0000000
--- a/src/com/android/contacts/util/HtmlUtils.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * 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.util;
-
-import android.content.Context;
-import android.content.res.Resources;
-import android.text.Html;
-import android.text.Html.ImageGetter;
-import android.text.Html.TagHandler;
-import android.text.SpannableStringBuilder;
-import android.text.Spanned;
-import android.text.TextUtils;
-import android.text.style.ImageSpan;
-import android.text.style.QuoteSpan;
-
-import com.android.contacts.R;
-import com.google.common.annotations.VisibleForTesting;
-
-/**
- * Provides static functions to perform custom HTML to text conversions.
- * Specifically, it adjusts the color and padding of the vertical
- * stripe on block quotes and alignment of inlined images.
- */
-@VisibleForTesting
-public class HtmlUtils {
-
- /**
- * Converts HTML string to a {@link Spanned} text, adjusting formatting. Any extra new line
- * characters at the end of the text will be trimmed.
- */
- public static Spanned fromHtml(Context context, String text) {
- if (TextUtils.isEmpty(text)) {
- return null;
- }
- Spanned spanned = Html.fromHtml(text);
- return postprocess(context, spanned);
- }
-
- /**
- * Converts HTML string to a {@link Spanned} text, adjusting formatting and using a custom
- * image getter. Any extra new line characters at the end of the text will be trimmed.
- */
- public static CharSequence fromHtml(Context context, String text, ImageGetter imageGetter,
- TagHandler tagHandler) {
- if (TextUtils.isEmpty(text)) {
- return null;
- }
- return postprocess(context, Html.fromHtml(text, imageGetter, tagHandler));
- }
-
- /**
- * Replaces some spans with custom versions of those. Any extra new line characters at the end
- * of the text will be trimmed.
- */
- @VisibleForTesting
- static Spanned postprocess(Context context, Spanned original) {
- if (original == null) {
- return null;
- }
- final int length = original.length();
- if (length == 0) {
- return original; // Bail early.
- }
-
- // If it's a SpannableStringBuilder, just use it. Otherwise, create a new
- // SpannableStringBuilder based on the passed Spanned.
- final SpannableStringBuilder builder;
- if (original instanceof SpannableStringBuilder) {
- builder = (SpannableStringBuilder) original;
- } else {
- builder = new SpannableStringBuilder(original);
- }
-
- final QuoteSpan[] quoteSpans = builder.getSpans(0, length, QuoteSpan.class);
- if (quoteSpans != null && quoteSpans.length != 0) {
- Resources resources = context.getResources();
- int color = resources.getColor(R.color.stream_item_stripe_color);
- int width = resources.getDimensionPixelSize(R.dimen.stream_item_stripe_width);
- for (int i = 0; i < quoteSpans.length; i++) {
- replaceSpan(builder, quoteSpans[i], new StreamItemQuoteSpan(color, width));
- }
- }
-
- final ImageSpan[] imageSpans = builder.getSpans(0, length, ImageSpan.class);
- if (imageSpans != null) {
- for (int i = 0; i < imageSpans.length; i++) {
- ImageSpan span = imageSpans[i];
- replaceSpan(builder, span, new ImageSpan(span.getDrawable(),
- ImageSpan.ALIGN_BASELINE));
- }
- }
-
- // Trim the trailing new line characters at the end of the text (which can be added
- // when HTML block quote tags are turned into new line characters).
- int end = length;
- for (int i = builder.length() - 1; i >= 0; i--) {
- if (builder.charAt(i) != '\n') {
- break;
- }
- end = i;
- }
-
- // If there's no trailing newlines, just return it.
- if (end == length) {
- return builder;
- }
-
- // Otherwise, Return a substring of the original {@link Spanned} text
- // from the start index (inclusive) to the end index (exclusive).
- return new SpannableStringBuilder(builder, 0, end);
- }
-
- /**
- * Replaces one span with the other.
- */
- private static void replaceSpan(SpannableStringBuilder builder, Object originalSpan,
- Object newSpan) {
- builder.setSpan(newSpan,
- builder.getSpanStart(originalSpan),
- builder.getSpanEnd(originalSpan),
- builder.getSpanFlags(originalSpan));
- builder.removeSpan(originalSpan);
- }
-
- public static class StreamItemQuoteSpan extends QuoteSpan {
- private final int mWidth;
-
- public StreamItemQuoteSpan(int color, int width) {
- super(color);
- this.mWidth = width;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public int getLeadingMargin(boolean first) {
- return mWidth;
- }
- }
-}
diff --git a/src/com/android/contacts/util/StreamItemEntry.java b/src/com/android/contacts/util/StreamItemEntry.java
deleted file mode 100644
index e5696a1..0000000
--- a/src/com/android/contacts/util/StreamItemEntry.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * 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.util;
-
-import android.content.Context;
-import android.database.Cursor;
-import android.provider.ContactsContract.StreamItems;
-import android.text.Html;
-
-import com.android.contacts.detail.ContactDetailDisplayUtils;
-import com.android.contacts.common.test.NeededForTesting;
-
-import com.google.common.annotations.VisibleForTesting;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * Data object for a social stream item. Social stream items may contain multiple
- * mPhotos. Social stream item entries are comparable; entries with more recent
- * timestamps will be displayed on top.
- */
-public class StreamItemEntry implements Comparable<StreamItemEntry> {
-
- // Basic stream item fields.
- private final long mId;
- private final String mText;
- private final String mComments;
- private final long mTimestamp;
- private final String mAccountType;
- private final String mAccountName;
- private final String mDataSet;
-
- private boolean mDecoded;
- private CharSequence mDecodedText;
- private CharSequence mDecodedComments;
-
- // Package references for label and icon resources.
- private final String mResPackage;
- private final String mIconRes;
- private final String mLabelRes;
-
- // Photos associated with this stream item.
- private List<StreamItemPhotoEntry> mPhotos;
-
- @NeededForTesting
- public static StreamItemEntry createForTest(long id, String text, String comments,
- long timestamp, String accountType, String accountName, String dataSet,
- String resPackage, String iconRes, String labelRes) {
- return new StreamItemEntry(id, text, comments, timestamp, accountType, accountName, dataSet,
- resPackage, iconRes, labelRes);
- }
-
- private StreamItemEntry(long id, String text, String comments, long timestamp,
- String accountType, String accountName, String dataSet, String resPackage,
- String iconRes, String labelRes) {
- mId = id;
- mText = text;
- mComments = comments;
- mTimestamp = timestamp;
- mAccountType = accountType;
- mAccountName = accountName;
- mDataSet = dataSet;
- mResPackage = resPackage;
- mIconRes = iconRes;
- mLabelRes = labelRes;
- mPhotos = new ArrayList<StreamItemPhotoEntry>();
- }
-
- public StreamItemEntry(Cursor cursor) {
- // This is expected to be populated via a cursor containing all StreamItems columns in
- // its projection.
- mId = getLong(cursor, StreamItems._ID);
- mText = getString(cursor, StreamItems.TEXT);
- mComments = getString(cursor, StreamItems.COMMENTS);
- mTimestamp = getLong(cursor, StreamItems.TIMESTAMP);
- mAccountType = getString(cursor, StreamItems.ACCOUNT_TYPE);
- mAccountName = getString(cursor, StreamItems.ACCOUNT_NAME);
- mDataSet = getString(cursor, StreamItems.DATA_SET);
- mResPackage = getString(cursor, StreamItems.RES_PACKAGE);
- mIconRes = getString(cursor, StreamItems.RES_ICON);
- mLabelRes = getString(cursor, StreamItems.RES_LABEL);
- mPhotos = new ArrayList<StreamItemPhotoEntry>();
- }
-
- public void addPhoto(StreamItemPhotoEntry photoEntry) {
- mPhotos.add(photoEntry);
- }
-
- @Override
- public int compareTo(StreamItemEntry other) {
- return mTimestamp == other.mTimestamp ? 0 : mTimestamp > other.mTimestamp ? -1 : 1;
- }
-
- public long getId() {
- return mId;
- }
-
- public String getText() {
- return mText;
- }
-
- public String getComments() {
- return mComments;
- }
-
- public long getTimestamp() {
- return mTimestamp;
- }
-
- public String getAccountType() {
- return mAccountType;
- }
-
- public String getAccountName() {
- return mAccountName;
- }
-
- public String getDataSet() {
- return mDataSet;
- }
-
- public String getResPackage() {
- return mResPackage;
- }
-
- public String getIconRes() {
- return mIconRes;
- }
-
- public String getLabelRes() {
- return mLabelRes;
- }
-
- public List<StreamItemPhotoEntry> getPhotos() {
- Collections.sort(mPhotos);
- return mPhotos;
- }
-
- /**
- * Make {@link #getDecodedText} and {@link #getDecodedComments} available. Must be called
- * before calling those.
- *
- * We can't do this automatically in the getters, because it'll require a {@link Context}.
- */
- @VisibleForTesting
- public void decodeHtml(Context context) {
- final Html.ImageGetter imageGetter = ContactDetailDisplayUtils.getImageGetter(context);
- if (mText != null) {
- mDecodedText = HtmlUtils.fromHtml(context, mText, imageGetter, null);
- }
- if (mComments != null) {
- mDecodedComments = HtmlUtils.fromHtml(context, mComments, imageGetter, null);
- }
- mDecoded = true;
- }
-
- public CharSequence getDecodedText() {
- checkDecoded();
- return mDecodedText;
- }
-
- public CharSequence getDecodedComments() {
- checkDecoded();
- return mDecodedComments;
- }
-
- private void checkDecoded() {
- if (!mDecoded) {
- throw new IllegalStateException("decodeHtml must have been called");
- }
- }
-
- private static String getString(Cursor cursor, String columnName) {
- return cursor.getString(cursor.getColumnIndex(columnName));
- }
-
- private static long getLong(Cursor cursor, String columnName) {
- final int columnIndex = cursor.getColumnIndex(columnName);
- return cursor.getLong(columnIndex);
- }
-}
diff --git a/src/com/android/contacts/util/StreamItemPhotoEntry.java b/src/com/android/contacts/util/StreamItemPhotoEntry.java
deleted file mode 100644
index ad69e5c..0000000
--- a/src/com/android/contacts/util/StreamItemPhotoEntry.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.util;
-
-import android.database.Cursor;
-import android.provider.ContactsContract.PhotoFiles;
-import android.provider.ContactsContract.StreamItemPhotos;
-
-/**
- * Data object for a photo associated with a social stream item. These are comparable;
- * entries with a lower sort index will be displayed on top (with the ID used as a
- * tie-breaker).
- */
-public class StreamItemPhotoEntry implements Comparable<StreamItemPhotoEntry> {
- private final long mId;
- private final int mSortIndex;
- private final long mPhotoFileId;
- private final String mPhotoUri;
- private final int mHeight;
- private final int mWidth;
- private final int mFileSize;
-
- public StreamItemPhotoEntry(long id, int sortIndex, long photoFileId, String photoUri,
- int height, int width, int fileSize) {
- mId = id;
- mSortIndex = sortIndex;
- mPhotoFileId = photoFileId;
- mPhotoUri = photoUri;
- mHeight = height;
- mWidth = width;
- mFileSize = fileSize;
- }
-
- public StreamItemPhotoEntry(Cursor cursor) {
- // This is expected to be populated via a cursor containing a join of all
- // StreamItemPhotos columns and all PhotoFiles columns (except for ID).
- mId = getLong(cursor, StreamItemPhotos._ID);
- mSortIndex = getInt(cursor, StreamItemPhotos.SORT_INDEX, -1);
- mPhotoFileId = getLong(cursor, StreamItemPhotos.PHOTO_FILE_ID);
- mPhotoUri = getString(cursor, StreamItemPhotos.PHOTO_URI);
- mHeight = getInt(cursor, PhotoFiles.HEIGHT, -1);
- mWidth = getInt(cursor, PhotoFiles.WIDTH, -1);
- mFileSize = getInt(cursor, PhotoFiles.FILESIZE, -1);
- }
-
- public long getId() {
- return mId;
- }
-
- public int getSortIndex() {
- return mSortIndex;
- }
-
- public long getPhotoFileId() {
- return mPhotoFileId;
- }
-
- public String getPhotoUri() {
- return mPhotoUri;
- }
-
- public int getHeight() {
- return mHeight;
- }
-
- public int getWidth() {
- return mWidth;
- }
-
- public int getFileSize() {
- return mFileSize;
- }
-
- @Override
- public int compareTo(StreamItemPhotoEntry streamItemPhotoEntry) {
- // Sort index is used to compare, falling back to ID if neither entry has a
- // sort index specified (entries without a sort index are sorted after entries
- // that have one).
- if (mSortIndex == streamItemPhotoEntry.mSortIndex) {
- if (mSortIndex == -1) {
- return mId == streamItemPhotoEntry.mId ? 0
- : mId < streamItemPhotoEntry.mId ? -1 : 1;
- } else {
- return 0;
- }
- } else {
- if (mSortIndex == -1) {
- return 1;
- }
- if (streamItemPhotoEntry.mSortIndex == -1) {
- return -1;
- }
- return mSortIndex == streamItemPhotoEntry.mSortIndex ? 0
- : mSortIndex < streamItemPhotoEntry.mSortIndex ? -1 : 1;
- }
- }
-
- private static String getString(Cursor cursor, String columnName) {
- return cursor.getString(cursor.getColumnIndex(columnName));
- }
-
- private static int getInt(Cursor cursor, String columnName, int missingValue) {
- final int columnIndex = cursor.getColumnIndex(columnName);
- return cursor.isNull(columnIndex) ? missingValue : cursor.getInt(columnIndex);
- }
-
- private static long getLong(Cursor cursor, String columnName) {
- final int columnIndex = cursor.getColumnIndex(columnName);
- return cursor.getLong(columnIndex);
- }
-}
diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml
index 7a7df01..46e7ac3 100644
--- a/tests/AndroidManifest.xml
+++ b/tests/AndroidManifest.xml
@@ -76,16 +76,6 @@
</intent-filter>
</activity>
- <activity android:name=".streamitems.StreamItemPopulatorActivity"
- android:label="@string/streamItemPopulator"
- >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
- <category android:name="android.intent.category.DEFAULT" />
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
- </activity>
-
<!--
Test authenticators/sync adapters.
diff --git a/tests/res/layout/stream_item_populator.xml b/tests/res/layout/stream_item_populator.xml
deleted file mode 100644
index acc46bf..0000000
--- a/tests/res/layout/stream_item_populator.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?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:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:gravity="center"
->
- <Button
- android:id="@+id/add"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/chooseAContactButton"
- android:layout_marginBottom="50px"
- />
- <Button
- android:id="@+id/exit"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/exitButton"
- />
-</LinearLayout>
diff --git a/tests/res/values/donottranslate_strings.xml b/tests/res/values/donottranslate_strings.xml
index b3f3ee7..44283ff 100644
--- a/tests/res/values/donottranslate_strings.xml
+++ b/tests/res/values/donottranslate_strings.xml
@@ -97,10 +97,7 @@
<string name="useRandomNumbers">Use random numbers</string>
<string name="addedLogEntriesToast">Added %1$d call log entries.</string>
<string name="noLogEntriesToast">No entries in the call log yet. Need at least one record for the template. Or use random numbers.</string>
-
- <string name="chooseAContactButton">Choose a contact to add stream items to</string>
<string name="exitButton">Exit</string>
- <string name="streamItemPopulator">Populate stream items</string>
<string-array name="pinnedHeaderUseCases">
<item>One short section - no headers</item>
diff --git a/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java b/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java
deleted file mode 100644
index 07b3691..0000000
--- a/tests/src/com/android/contacts/detail/ContactDetailDisplayUtilsTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.content.Context;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.text.Html;
-import android.text.Spanned;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.widget.TextView;
-
-import com.android.contacts.R;
-import com.android.contacts.util.StreamItemEntry;
-import com.android.contacts.util.StreamItemEntryBuilder;
-
-/**
- * Unit tests for {@link ContactDetailDisplayUtils}.
- */
-@SmallTest
-public class ContactDetailDisplayUtilsTest extends AndroidTestCase {
- private static final String TEST_STREAM_ITEM_TEXT = "text";
-
- private LayoutInflater mLayoutInflater;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mLayoutInflater =
- (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testAddStreamItemText_IncludesComments() {
- StreamItemEntry streamItem = getTestBuilder().setComment("1 comment").build(getContext());
- View streamItemView = addStreamItemText(streamItem);
- assertHasText(streamItemView, R.id.stream_item_comments, "1 comment");
- }
-
- public void testAddStreamItemText_IncludesHtmlComments() {
- StreamItemEntry streamItem = getTestBuilder().setComment("1 <b>comment</b>")
- .build(getContext());
- View streamItemView = addStreamItemText(streamItem);
- assertHasHtmlText(streamItemView, R.id.stream_item_comments, "1 <b>comment<b>");
- }
-
- public void testAddStreamItemText_NoComments() {
- StreamItemEntry streamItem = getTestBuilder().setComment(null).build(getContext());
- View streamItemView = addStreamItemText(streamItem);
- assertGone(streamItemView, R.id.stream_item_comments);
- }
-
- /** Checks that the given id corresponds to a visible text view with the expected text. */
- private void assertHasText(View parent, int textViewId, String expectedText) {
- TextView textView = (TextView) parent.findViewById(textViewId);
- assertNotNull(textView);
- assertEquals(View.VISIBLE, textView.getVisibility());
- assertEquals(expectedText, textView.getText().toString());
- }
-
- /** Checks that the given id corresponds to a visible text view with the expected HTML. */
- private void assertHasHtmlText(View parent, int textViewId, String expectedHtml) {
- TextView textView = (TextView) parent.findViewById(textViewId);
- assertNotNull(textView);
- assertEquals(View.VISIBLE, textView.getVisibility());
- assertSpannableEquals(Html.fromHtml(expectedHtml), textView.getText());
- }
-
- /**
- * Asserts that a char sequence is actually a {@link Spanned} matching the one expected.
- */
- private void assertSpannableEquals(Spanned expected, CharSequence actualCharSequence) {
- assertEquals(expected.toString(), actualCharSequence.toString());
- assertTrue("char sequence should be an instance of Spanned",
- actualCharSequence instanceof Spanned);
- Spanned actual = (Spanned) actualCharSequence;
- assertEquals(Html.toHtml(expected), Html.toHtml(actual));
- }
-
- /** Checks that the given id corresponds to a gone view. */
- private void assertGone(View parent, int textId) {
- View view = parent.findViewById(textId);
- assertNotNull(view);
- assertEquals(View.GONE, view.getVisibility());
- }
-
- /**
- * Calls {@link ContactDetailDisplayUtils#addStreamItemText(LayoutInflater, Context,
- * StreamItemEntry, View)} with the default parameters and the given stream item.
- */
- private View addStreamItemText(StreamItemEntry streamItem) {
- return ContactDetailDisplayUtils.addStreamItemText(getContext(), streamItem,
- mLayoutInflater.inflate(R.layout.stream_item_container, null));
- }
-
- private StreamItemEntryBuilder getTestBuilder() {
- return new StreamItemEntryBuilder().setText(TEST_STREAM_ITEM_TEXT);
- }
-}
diff --git a/tests/src/com/android/contacts/detail/StreamItemAdapterTest.java b/tests/src/com/android/contacts/detail/StreamItemAdapterTest.java
deleted file mode 100644
index abd4680..0000000
--- a/tests/src/com/android/contacts/detail/StreamItemAdapterTest.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.view.View;
-
-import com.android.contacts.util.StreamItemEntry;
-import com.android.contacts.util.StreamItemEntryBuilder;
-
-import com.google.common.collect.Lists;
-
-import java.util.ArrayList;
-
-// TODO: We should have tests for action, but that requires a mock sync-adapter that specifies
-// an action or doesn't
-
-// TODO Add test for photo click
-
-/**
- * Unit tests for {@link StreamItemAdapter}.
- */
-@SmallTest
-public class StreamItemAdapterTest extends AndroidTestCase {
- private StreamItemAdapter mAdapter;
- private FakeOnClickListener mListener;
- private FakeOnClickListener mPhotoListener;
- private View mView;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- mListener = new FakeOnClickListener();
- mAdapter = new StreamItemAdapter(getContext(), mListener, mPhotoListener);
- }
-
- @Override
- protected void tearDown() throws Exception {
- mAdapter = null;
- mListener = null;
- super.tearDown();
- }
-
- public void testGetCount_Empty() {
- mAdapter.setStreamItems(createStreamItemList(0));
- // The header and title are gone when there are no stream items.
- assertEquals(0, mAdapter.getCount());
- }
-
- public void testGetCount_NonEmpty() {
- mAdapter.setStreamItems(createStreamItemList(3));
- // There is one extra view: the header.
- assertEquals(4, mAdapter.getCount());
- }
-
- public void testGetView_Header() {
- // Just check that we can inflate it correctly.
- mView = mAdapter.getView(0, null, null);
- }
-
- /** Counter used by {@link #createStreamItemEntryBuilder()} to create unique builders. */
- private int mCreateStreamItemEntryBuilderCounter = 0;
-
- /** Returns a stream item builder with basic information in it. */
- private StreamItemEntryBuilder createStreamItemEntryBuilder() {
- return new StreamItemEntryBuilder().setText(
- "text #" + mCreateStreamItemEntryBuilderCounter++);
- }
-
- /** Creates a list containing the given number of {@link StreamItemEntry}s. */
- private ArrayList<StreamItemEntry> createStreamItemList(int count) {
- ArrayList<StreamItemEntry> list = Lists.newArrayList();
- for (int index = 0; index < count; ++index) {
- list.add(createStreamItemEntryBuilder().build(getContext()));
- }
- return list;
- }
-
- /** Checks that the stream item view has a click listener. */
- private void assertStreamItemViewHasOnClickListener() {
- assertFalse("listener should have not been invoked yet", mListener.clicked);
- mView.performClick();
- assertTrue("listener should have been invoked", mListener.clicked);
- }
-
- /** Checks that the stream item view does not have a click listener. */
- private void assertStreamItemViewHasNoOnClickListener() {
- assertFalse("listener should have not been invoked yet", mListener.clicked);
- mView.performClick();
- assertFalse("listener should have not been invoked", mListener.clicked);
- }
-
- /** Checks that the stream item view is clickable. */
- private void assertStreamItemViewFocusable() {
- assertNotNull("should have a stream item", mView);
- assertTrue("should be focusable", mView.isFocusable());
- }
-
- /** Asserts that there is a stream item but it is not clickable. */
- private void assertStreamItemViewNotFocusable() {
- assertNotNull("should have a stream item", mView);
- assertFalse("should not be focusable", mView.isFocusable());
- }
-
- /** Checks that the stream item view has the given stream item as its tag. */
- private void assertStreamItemViewHasTag(StreamItemEntry streamItem) {
- Object tag = mView.getTag();
- assertNotNull("should have a tag", tag);
- assertTrue("should be a StreamItemEntry", tag instanceof StreamItemEntry);
- StreamItemEntry streamItemTag = (StreamItemEntry) tag;
- // The streamItem itself should be in the tag.
- assertSame(streamItem, streamItemTag);
- }
-
- /** Checks that the stream item view has the given stream item as its tag. */
- private void assertStreamItemViewHasNoTag() {
- Object tag = mView.getTag();
- assertNull("should not have a tag", tag);
- }
-
- /**
- * Simple fake implementation of {@link View.OnClickListener} which sets a member variable to
- * true when clicked.
- */
- private final class FakeOnClickListener implements View.OnClickListener {
- public boolean clicked = false;
-
- @Override
- public void onClick(View view) {
- clicked = true;
- }
- }
-}
diff --git a/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java b/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java
deleted file mode 100644
index 9132e40..0000000
--- a/tests/src/com/android/contacts/tests/streamitems/StreamItemPopulatorActivity.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * 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.tests.streamitems;
-
-import android.app.Activity;
-import android.content.ContentProviderOperation;
-import android.content.ContentUris;
-import android.content.ContentValues;
-import android.content.Intent;
-import android.database.Cursor;
-import android.net.Uri;
-import android.os.Bundle;
-import android.provider.ContactsContract;
-import android.provider.ContactsContract.RawContacts;
-import android.provider.ContactsContract.StreamItemPhotos;
-import android.provider.ContactsContract.StreamItems;
-import android.view.View;
-import android.widget.Button;
-import android.widget.Toast;
-
-import com.android.contacts.common.model.account.GoogleAccountType;
-import com.android.contacts.tests.R;
-import com.google.common.collect.Lists;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Random;
-
-/**
- * Testing activity that will populate stream items and stream item photos to selected
- * entries in the user's contacts list.
- *
- * The contact selected must have at least one raw contact that was provided by Google.
- */
-public class StreamItemPopulatorActivity extends Activity {
-
- // Test data to randomly select from.
- private String[] snippetStrings = new String[]{
- "Just got back from a vacation in %1$s - what a great place! Can't wait to go back.",
- "If I never see %1$s again it will be too soon.",
- "This is a public service announcement. If you were even close to considering visiting"
- + " %1$s, I strongly advise you to reconsider. The food was terrible, the people were "
- + "rude, the hygiene of the bus and taxi drivers was positively <i>barbaric</i>. I "
- + "feared for my life almost the entire time I was there, and feel lucky to be back "
- + "<b>home</b>.",
- "Check out these pictures! I took them in %1$s"
- };
-
- private String[] placeNames = new String[]{
- "the Google campus in Mountain View",
- "the deserts on Arrakis",
- "Iceland",
- "Japan",
- "Sydney",
- "San Francisco",
- "Munich",
- "Istanbul",
- "Tanagra",
- "the restricted section of Area 51",
- "the middle of nowhere"
- };
-
- private String[] commentStrings = new String[]{
- "3 retweets",
- "5 shares",
- "4 likes",
- "4 +1s",
- "<i>24567</i> <font color='blue' size='+1'><b>likes</b></font>"
- };
-
- private String[] labelResources = new String[] {
- "attribution_google_plus",
- "attribution_google_talk",
- "attribution_flicker",
- "attribution_twitter"
- };
-
- public String[] iconResources = new String[] {
- "default_icon"
- };
-
- // Photos to randomly select from.
- private Integer[] imageIds = new Integer[]{
- R.drawable.android,
- R.drawable.goldengate,
- R.drawable.iceland,
- R.drawable.japan,
- R.drawable.sydney,
- R.drawable.wharf,
- R.drawable.whiskey
- };
-
- // Only some photos have actions.
- private String[] imageStrings = new String[]{
- "android",
- "goldengate",
- "iceland",
- "japan",
- };
-
- // The contact ID that was picked.
- private long mContactId = -1;
-
- private Random mRandom;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- mRandom = new Random(System.currentTimeMillis());
-
- setContentView(R.layout.stream_item_populator);
- Button pickButton = (Button) findViewById(R.id.add);
- pickButton.setOnClickListener(new View.OnClickListener(){
- @Override
- public void onClick(View v) {
- // Reset the contact ID.
- mContactId = -1;
-
- // Forward the Intent to the picker
- final Intent pickerIntent =
- new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
- pickerIntent.setFlags(
- Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivityForResult(pickerIntent, 0);
- }
- });
-
- Button exitButton = (Button) findViewById(R.id.exit);
- exitButton.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- finish();
- }
- });
- }
-
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- if (resultCode == Activity.RESULT_OK) {
- Uri contactUri = data.getData();
- mContactId = ContentUris.parseId(contactUri);
- }
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- if (mContactId != -1) {
- long rawContactId = -1;
- String accountType = null;
- String accountName = null;
- String dataSet = null;
-
- // Lookup the com.google raw contact for the contact.
- Cursor c = getContentResolver().query(RawContacts.CONTENT_URI,
- new String[]{
- RawContacts._ID,
- RawContacts.ACCOUNT_TYPE,
- RawContacts.ACCOUNT_NAME
- },
- RawContacts.CONTACT_ID + "=? AND " + RawContacts.ACCOUNT_TYPE + "=?",
- new String[]{String.valueOf(mContactId), GoogleAccountType.ACCOUNT_TYPE}, null);
- try {
- c.moveToFirst();
- rawContactId = c.getLong(0);
- accountType = c.getString(1);
- accountName = c.getString(2);
- } finally {
- c.close();
- }
- if (rawContactId != -1) {
- addStreamItemsToRawContact(rawContactId, accountType, accountName);
- } else {
- Toast.makeText(this,
- "Failed to find raw contact ID for contact ID " + mContactId, 5).show();
- }
- }
- }
-
- protected byte[] loadPhotoFromResource(int resourceId) {
- InputStream is = getResources().openRawResource(resourceId);
- return readInputStreamFully(is);
- }
-
- protected byte[] readInputStreamFully(InputStream is) {
- try {
- byte[] buffer = new byte[is.available()];
- is.read(buffer);
- is.close();
- return buffer;
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private void addStreamItemsToRawContact(long rawContactId, String accountType,
- String accountName) {
- ArrayList<ContentProviderOperation> ops = Lists.newArrayList();
-
- // Add from 1-5 stream items.
- int itemsToAdd = randInt(5) + 1;
- int opCount = 0;
- for (int i = 0; i < itemsToAdd; i++) {
- ContentValues streamItemValues = buildStreamItemValues(accountType, accountName);
- ops.add(ContentProviderOperation.newInsert(
- Uri.withAppendedPath(
- ContentUris.withAppendedId(ContactsContract.RawContacts.CONTENT_URI,
- rawContactId),
- ContactsContract.RawContacts.StreamItems.CONTENT_DIRECTORY))
- .withValues(streamItemValues).build());
-
- // Maybe add photos - 30% chance per stream item.
- boolean includePhotos = randInt(100) < 30;
- if (includePhotos) {
- // Add 1-5 photos if we're including any.
- int numPhotos = randInt(5) + 1;
- for (int j = 0; j < numPhotos; j++) {
- ContentValues streamItemPhotoValues =
- buildStreamItemPhotoValues(j, accountType, accountName);
- ops.add(ContentProviderOperation.newInsert(StreamItems.CONTENT_PHOTO_URI)
- .withValues(streamItemPhotoValues)
- .withValueBackReference(StreamItemPhotos.STREAM_ITEM_ID, opCount)
- .build());
- }
- opCount += numPhotos;
- }
- opCount++;
- }
- try {
- getContentResolver().applyBatch(ContactsContract.AUTHORITY, ops);
- } catch (Exception e) {
- // We don't care. This is just for test purposes.
- throw new RuntimeException(e);
- }
- Toast.makeText(this, "Added " + itemsToAdd + " stream item(s) and "
- + (opCount - itemsToAdd) + " photos", 5).show();
- }
-
- private ContentValues buildStreamItemValues(String accountType, String accountName) {
- boolean includeAttribution = randInt(100) < 70;
- boolean includeComments = randInt(100) < 30;
- boolean includeAction = randInt(100) < 30;
- ContentValues values = new ContentValues();
- String place = pickRandom(placeNames);
- values.put(StreamItems.TEXT,
- String.format(pickRandom(snippetStrings) , place)
- + (includeComments ? " [c]" : "")
- + (includeAction ? " [a]" : ""));
- if (includeAttribution) {
- values.put(StreamItems.RES_PACKAGE, "com.android.contacts.tests");
- int sourceIndex = randInt(labelResources.length);
- values.put(StreamItems.RES_LABEL, labelResources[sourceIndex]);
- if (sourceIndex < iconResources.length) {
- values.put(StreamItems.RES_ICON, iconResources[sourceIndex]);
- }
- }
- if (includeComments) {
- values.put(StreamItems.COMMENTS, pickRandom(commentStrings));
- } else {
- values.put(StreamItems.COMMENTS, "");
- }
- // Set the timestamp to some point in the past.
- values.put(StreamItems.TIMESTAMP,
- System.currentTimeMillis() - randInt(360000000));
- values.put(RawContacts.ACCOUNT_TYPE, accountType);
- values.put(RawContacts.ACCOUNT_NAME, accountName);
- return values;
- }
-
- private ContentValues buildStreamItemPhotoValues(int index, String accountType,
- String accountName) {
- Integer imageIndex = pickRandom(imageIds);
- ContentValues values = new ContentValues();
- values.put(StreamItemPhotos.SORT_INDEX, index);
- values.put(StreamItemPhotos.PHOTO, loadPhotoFromResource(imageIndex));
- values.put(RawContacts.ACCOUNT_TYPE, accountType);
- values.put(RawContacts.ACCOUNT_NAME, accountName);
- return values;
- }
-
- private <T> T pickRandom(T[] from) {
- return from[randInt(from.length)];
- }
-
- private int randInt(int max) {
- return Math.abs(mRandom.nextInt()) % max;
- }
-}
diff --git a/tests/src/com/android/contacts/util/HtmlUtilsTest.java b/tests/src/com/android/contacts/util/HtmlUtilsTest.java
deleted file mode 100644
index 772e78f..0000000
--- a/tests/src/com/android/contacts/util/HtmlUtilsTest.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * 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.util;
-
-import android.graphics.drawable.ColorDrawable;
-import android.test.AndroidTestCase;
-import android.test.suitebuilder.annotation.SmallTest;
-import android.text.SpannableStringBuilder;
-import android.text.Spanned;
-import android.text.SpannedString;
-import android.text.style.ImageSpan;
-import android.text.style.QuoteSpan;
-
-import com.android.contacts.util.HtmlUtils.StreamItemQuoteSpan;
-
-/**
- * Tests for {@link HtmlUtils}.
- *
- * adb shell am instrument -w -e class com.android.contacts.util.HtmlUtilsTest \
- com.android.contacts.tests/android.test.InstrumentationTestRunner
- */
-@SmallTest
-public class HtmlUtilsTest extends AndroidTestCase {
- /**
- * Test for {@link HtmlUtils#postprocess} specifically about trimming newlines.
- */
- public void testPostProcess_trimNewLines() {
- checkTrimNewLines("", "");
- checkTrimNewLines("", "\n");
- checkTrimNewLines("", "\n\n");
- checkTrimNewLines("a", "a");
- checkTrimNewLines("abc", "abc");
- checkTrimNewLines("abc", "abc\n");
- checkTrimNewLines("abc", "abc\n\n\n");
- checkTrimNewLines("ab\nc", "ab\nc\n");
-
- assertNull(HtmlUtils.postprocess(getContext(), null));
- }
-
- private final void checkTrimNewLines(String expectedString, CharSequence text) {
- // Test with both SpannedString and SpannableStringBuilder.
- assertEquals(expectedString,
- HtmlUtils.postprocess(getContext(), new SpannedString(text)).toString());
-
- assertEquals(expectedString,
- HtmlUtils.postprocess(getContext(), new SpannableStringBuilder(text)).toString());
- }
-
- public void testPostProcess_with_newlines() {
- final SpannableStringBuilder builder = new SpannableStringBuilder("01234\n\n");
-
- setSpans(builder);
-
- // First test with a SpannableStringBuilder, as opposed to SpannedString
- checkPostProcess(HtmlUtils.postprocess(getContext(), builder));
-
- // Then pass a SpannedString, which is immutable, but the method should still work.
- checkPostProcess(HtmlUtils.postprocess(getContext(), new SpannedString(builder)));
- }
-
- /**
- * Same as {@link #testPostProcess_with_newlines}, but text has no newlines.
- * (The internal code path is slightly different.)
- */
- public void testPostProcess_no_newlines() {
- final SpannableStringBuilder builder = new SpannableStringBuilder("01234");
-
- setSpans(builder);
-
- // First test with a SpannableStringBuilder, as opposed to SpannedString
- checkPostProcess(HtmlUtils.postprocess(getContext(), builder));
-
- // Then pass a SpannedString, which is immutable, but the method should still work.
- checkPostProcess(HtmlUtils.postprocess(getContext(), new SpannedString(builder)));
- }
-
- private void setSpans(SpannableStringBuilder builder) {
- builder.setSpan(new ImageSpan(new ColorDrawable(), ImageSpan.ALIGN_BOTTOM), 0, 2, 0);
- builder.setSpan(new QuoteSpan(), 2, 4, 0);
- builder.setSpan(new CustomSpan(), 4, builder.length(), 0);
- }
-
- private void checkPostProcess(Spanned ret) {
- // Newlines should be trimmed.
- assertEquals("01234", ret.toString());
-
- // First, check the image span.
- // - Vertical alignment should be changed to ALIGN_BASELINE
- // - Drawable shouldn't be changed.
- ImageSpan[] imageSpans = ret.getSpans(0, ret.length(), ImageSpan.class);
- assertEquals(1, imageSpans.length);
- assertEquals(ImageSpan.ALIGN_BASELINE, imageSpans[0].getVerticalAlignment());
- assertEquals(ColorDrawable.class, imageSpans[0].getDrawable().getClass());
-
- // QuoteSpans should be replaced with StreamItemQuoteSpans.
- QuoteSpan[] quoteSpans = ret.getSpans(0, ret.length(), QuoteSpan.class);
- assertEquals(1, quoteSpans.length);
- assertEquals(StreamItemQuoteSpan.class, quoteSpans[0].getClass());
-
- // Other spans should be preserved.
- CustomSpan[] customSpans = ret.getSpans(0, ret.length(), CustomSpan.class);
- assertEquals(1, customSpans.length);
- }
-
- /** Custom span class used in {@link #testPostProcess} */
- private static class CustomSpan {
- }
-}
diff --git a/tests/src/com/android/contacts/util/StreamItemEntryBuilder.java b/tests/src/com/android/contacts/util/StreamItemEntryBuilder.java
deleted file mode 100644
index 9eb550e..0000000
--- a/tests/src/com/android/contacts/util/StreamItemEntryBuilder.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.util;
-
-import android.content.Context;
-
-/**
- * Builder for {@link StreamItemEntry}s to make writing tests easier.
- */
-public class StreamItemEntryBuilder {
- private long mId;
- private String mText;
- private String mComment;
- private long mTimestamp;
- private String mAccountType;
- private String mAccountName;
- private String mDataSet;
- private String mResPackage;
- private String mIconRes;
- private String mLabelRes;
-
- public StreamItemEntryBuilder() {}
-
- public StreamItemEntryBuilder setText(String value) {
- mText = value;
- return this;
- }
-
- public StreamItemEntryBuilder setComment(String value) {
- mComment = value;
- return this;
- }
-
- public StreamItemEntryBuilder setAccountType(String value) {
- mAccountType = value;
- return this;
- }
-
- public StreamItemEntryBuilder setAccountName(String value) {
- mAccountName = value;
- return this;
- }
-
- public StreamItemEntryBuilder setDataSet(String value) {
- mDataSet = value;
- return this;
- }
-
- public StreamItemEntry build(Context context) {
- StreamItemEntry ret = StreamItemEntry.createForTest(mId, mText, mComment, mTimestamp,
- mAccountType, mAccountName, mDataSet, mResPackage, mIconRes, mLabelRes);
- ret.decodeHtml(context);
- return ret;
- }
-}