Merge "Add touch feedback to QC header"
diff --git a/res/drawable/quickcontact_card_border.xml b/res/drawable/quickcontact_card_border.xml
new file mode 100644
index 0000000..f0daea1
--- /dev/null
+++ b/res/drawable/quickcontact_card_border.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 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.
+-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <stroke
+        android:width="@dimen/expanding_entry_card_border_width"
+        android:color="@color/card_margin_color"/>
+</shape>
diff --git a/res/layout/quickcontact_content.xml b/res/layout/quickcontact_content.xml
index b5b2a83..4f2d3d8 100644
--- a/res/layout/quickcontact_content.xml
+++ b/res/layout/quickcontact_content.xml
@@ -18,8 +18,7 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:fillViewport="true"
-    android:id="@+id/content_scroller"
-    android:background="@color/card_margin_color">
+    android:id="@+id/content_scroller">
 
     <!-- All the cards should be inserted into this LinearLayout -->
     <LinearLayout
@@ -27,16 +26,36 @@
         android:layout_height="match_parent"
         android:orientation="vertical"
         android:id="@+id/card_container">
-        <com.android.contacts.quickcontact.ExpandingEntryCardView
-            style="@style/ExpandingEntryCardStyle"
-            android:id="@+id/communication_card"
-            android:layout_marginTop="@dimen/communication_card_marginTop"
-            android:visibility="gone" />
 
-        <com.android.contacts.quickcontact.ExpandingEntryCardView
-            style="@style/ExpandingEntryCardStyle"
-            android:id="@+id/recent_card"
-            android:visibility="gone" />
+        <!-- We cannot set the border directly on ExpandingEntryCardView without it looking
+             funny because of the card's elevation value. So we need a parent FrameLayout -->
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/quickcontact_card_border">
+            <com.android.contacts.quickcontact.ExpandingEntryCardView
+                style="@style/ExpandingEntryCardStyle"
+                android:id="@+id/communication_card"
+                android:layout_marginTop="@dimen/communication_card_marginTop"
+                android:visibility="gone" />
+        </FrameLayout>
+
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/quickcontact_card_border">
+            <com.android.contacts.quickcontact.ExpandingEntryCardView
+                style="@style/ExpandingEntryCardStyle"
+                android:id="@+id/recent_card"
+                android:visibility="gone" />
+        </FrameLayout>
+
+        <!-- Fill the rest of the LinearLayout with the correct background color -->
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@color/card_margin_color" />
+
     </LinearLayout>
 
 </com.android.contacts.widget.TouchlessScrollView>
\ No newline at end of file
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index 5a2f7ab..79dd5d6 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -147,6 +147,9 @@
     <dimen name="expanding_entry_card_marginStart">12dp</dimen>
     <dimen name="expanding_entry_card_marginEnd">12dp</dimen>
     <dimen name="expanding_entry_card_marginBottom">12dp</dimen>
+    <!-- Width of the grey border surrounding the expanding entry cards. If we ever add
+         a rounded corner to the expanding entry cards, than we will need to increase this value -->
+    <dimen name="expanding_entry_card_border_width">12dp</dimen>
 
     <!-- Top margin for the communication card, used to add space from header. -->
     <dimen name="communication_card_marginTop">12dp</dimen>
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index 6573fa2..805ee39 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -1357,6 +1357,10 @@
             return true;
         }
 
+        public boolean shouldCollapseWith(DetailViewEntry entry, Context context) {
+            return false;
+        }
+
         @Override
         public void click(View clickedView, Listener fragmentListener) {
             if (fragmentListener == null || intent == null) return;
diff --git a/src/com/android/contacts/quickcontact/DataAction.java b/src/com/android/contacts/quickcontact/DataAction.java
index a0df1e6..37021ec 100644
--- a/src/com/android/contacts/quickcontact/DataAction.java
+++ b/src/com/android/contacts/quickcontact/DataAction.java
@@ -334,6 +334,10 @@
         return true;
     }
 
+    public boolean shouldCollapseWith(Action t, Context context) {
+        return false;
+    }
+
     @Override
     public Integer getTimesUsed() {
         return mTimesUsed;