Adding aggregation suggestions to the contact editor

Change-Id: Ie2db4c1c02301a46ca045d17914f68d4701d9db2
diff --git a/res/layout/aggregation_suggestions.xml b/res/layout/aggregation_suggestions.xml
new file mode 100644
index 0000000..684fe91
--- /dev/null
+++ b/res/layout/aggregation_suggestions.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 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.
+ */
+-->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:background="@drawable/suggestion_bg">
+    <TextView
+        android:id="@+id/aggregation_suggestion_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentTop="true"
+        android:layout_alignParentLeft="true"
+        android:layout_marginLeft="5dip"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="?android:attr/textColorPrimary"
+        android:textStyle="bold"
+    />
+
+    <LinearLayout
+        android:id="@+id/aggregation_suggestions"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+    />
+</LinearLayout>
diff --git a/res/layout/aggregation_suggestions_item.xml b/res/layout/aggregation_suggestions_item.xml
new file mode 100644
index 0000000..06d153e
--- /dev/null
+++ b/res/layout/aggregation_suggestions_item.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+ * Copyright 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.
+ */
+-->
+
+<view xmlns:android="http://schemas.android.com/apk/res/android"
+    class="com.android.contacts.ui.widget.AggregationSuggestionView"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:paddingLeft="5dip"
+    android:paddingRight="15dip"
+>
+    <Button
+        android:id="@+id/aggregation_suggestion_join_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:text="@string/aggregation_suggestion_join_button"
+        android:layout_centerInParent="true"
+        android:layout_alignParentRight="true"
+    />
+
+    <ImageView
+        android:id="@+id/aggregation_suggestion_photo"
+        android:layout_width="@dimen/aggregation_suggestion_icon_size"
+        android:layout_height="@dimen/aggregation_suggestion_icon_size"
+        android:layout_alignParentLeft="true"
+        android:layout_centerInParent="true"
+        android:layout_marginTop="4dip"
+        android:scaleType="fitCenter"
+    />
+
+    <TextView
+        android:id="@+id/aggregation_suggestion_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_toRightOf="@id/aggregation_suggestion_photo"
+        android:layout_toLeftOf="@id/aggregation_suggestion_join_button"
+        android:layout_marginLeft="10dip"
+        android:layout_marginTop="4dip"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="?android:attr/textColorSecondary"
+    />
+
+    <TextView
+        android:id="@+id/aggregation_suggestion_data"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_toRightOf="@id/aggregation_suggestion_photo"
+        android:layout_toLeftOf="@id/aggregation_suggestion_join_button"
+        android:layout_below="@id/aggregation_suggestion_name"
+        android:layout_marginLeft="10dip"
+        android:textAppearance="?android:attr/textAppearanceSmall"
+        android:textColor="?android:attr/textColorSecondary"
+    />
+</view>
diff --git a/res/layout/item_contact_editor.xml b/res/layout/item_contact_editor.xml
index b75c82a..6886503 100644
--- a/res/layout/item_contact_editor.xml
+++ b/res/layout/item_contact_editor.xml
@@ -105,6 +105,13 @@
             android:layout_marginTop="6dip"
             android:layout_marginBottom="4dip" />
 
+        <ViewStub android:id="@+id/aggregation_suggestion_stub"
+            android:inflatedId="@+id/aggregation_suggestion"
+            android:layout="@layout/aggregation_suggestions"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="visible"/>
+
         <LinearLayout
             android:id="@+id/sect_fields"
             android:layout_width="match_parent"