Merge "Don't show edit option if group membership isn't editable"
diff --git a/res/layout-sw680dp/people_activity.xml b/res/layout-sw680dp/people_activity.xml
index fbd4312..d6a59db 100644
--- a/res/layout-sw680dp/people_activity.xml
+++ b/res/layout-sw680dp/people_activity.xml
@@ -58,7 +58,7 @@
             android:id="@+id/contact_details_view"
             android:layout_width="0dip"
             android:layout_height="match_parent"
-            android:layout_weight="1"
+            android:layout_weight="2"
             android:background="@color/background_primary"
             android:visibility="gone">
 
@@ -87,7 +87,7 @@
             android:id="@+id/group_details_view"
             android:layout_width="0dip"
             android:layout_height="match_parent"
-            android:layout_weight="1"
+            android:layout_weight="2"
             android:visibility="gone">
 
             <!-- This is the group detail page -->
diff --git a/res/layout/group_account_header_vertical.xml b/res/layout/group_account_header_vertical.xml
index 8edbb8b..35b47fd 100644
--- a/res/layout/group_account_header_vertical.xml
+++ b/res/layout/group_account_header_vertical.xml
@@ -17,19 +17,17 @@
 <LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:minHeight="?attr/list_item_header_height"
+    android:layout_height="?attr/list_item_header_height"
     android:layout_marginLeft="?attr/list_item_padding_left"
     android:layout_marginRight="?attr/list_item_padding_right"
-    android:paddingBottom="4dip"
     android:background="@drawable/list_section_divider_holo_custom"
+    android:gravity="center_vertical"
     android:orientation="vertical">
 
     <TextView
         android:id="@+id/account_type"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
         android:paddingLeft="?attr/list_item_header_text_indent"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textColor="@color/people_app_theme_color"
@@ -43,7 +41,6 @@
         android:id="@+id/account_name"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_gravity="center_vertical"
         android:paddingLeft="?attr/list_item_header_text_indent"
         android:textColor="@color/contact_count_text_color"
         android:textSize="12sp"
diff --git a/res/layout/user_profile_header.xml b/res/layout/user_profile_header.xml
index 67b64d5..29fd1c6 100644
--- a/res/layout/user_profile_header.xml
+++ b/res/layout/user_profile_header.xml
@@ -19,12 +19,11 @@
     android:id="@+id/user_profile_header"
     android:orientation="horizontal"
     android:layout_width="match_parent"
-    android:layout_height="wrap_content"
-    android:paddingTop="@dimen/list_header_extra_top_padding"
+    android:layout_height="?attr/list_item_header_height"
     android:paddingLeft="?attr/list_item_padding_left"
-    android:paddingRight="?attr/list_item_padding_right" 
+    android:paddingRight="?attr/list_item_padding_right"
     android:background="@drawable/list_section_divider_holo_custom"
-    android:minHeight="?attr/list_item_header_height"
+    android:gravity="center_vertical"
     >
 
     <TextView
@@ -35,8 +34,6 @@
         android:text="@string/user_profile_contacts_list_header"
         android:textStyle="bold"
         android:ellipsize="end"
-        android:layout_gravity="left|bottom"
-        android:layout_marginBottom="2dip"
         android:layout_weight="1"
         android:textAllCaps="true"
         android:textAppearance="?android:attr/textAppearanceSmall"
@@ -49,8 +46,6 @@
         android:layout_height="wrap_content"
         android:singleLine="true"
         android:ellipsize="end"
-        android:layout_gravity="right|bottom"
-        android:layout_marginBottom="2dip"
         android:textAppearance="?android:attr/textAppearanceSmall"
         android:textSize="12sp"
         android:textColor="@color/contact_count_text_color" />
diff --git a/res/values-sw680dp/donottranslate_config.xml b/res/values-sw680dp/donottranslate_config.xml
deleted file mode 100644
index 5e5be30..0000000
--- a/res/values-sw680dp/donottranslate_config.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-** Copyright 2011, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-**     http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<resources>
-    <bool name="config_browse_list_show_images">true</bool>
-    <bool name="config_use_two_panes_in_favorites">true</bool>
-</resources>
diff --git a/src/com/android/contacts/detail/ContactDetailFragment.java b/src/com/android/contacts/detail/ContactDetailFragment.java
index ccdc403..d4d5fc7 100644
--- a/src/com/android/contacts/detail/ContactDetailFragment.java
+++ b/src/com/android/contacts/detail/ContactDetailFragment.java
@@ -461,6 +461,7 @@
         Collapser.collapseList(mPostalEntries);
         Collapser.collapseList(mImEntries);
         Collapser.collapseList(mEventEntries);
+        Collapser.collapseList(mWebsiteEntries);
 
         mIsUniqueNumber = mPhoneEntries.size() == 1;
         mIsUniqueEmail = mEmailEntries.size() == 1;
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 5498685..bb63b2e 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -949,6 +949,7 @@
         final MenuItem splitMenu = menu.findItem(R.id.menu_split);
         final MenuItem joinMenu = menu.findItem(R.id.menu_join);
         final MenuItem helpMenu = menu.findItem(R.id.menu_help);
+        final MenuItem discardMenu = menu.findItem(R.id.menu_discard);
 
         // Set visibility of menus
         doneMenu.setVisible(false);
@@ -959,6 +960,10 @@
         // Cannot join a user profile
         joinMenu.setVisible(!isEditingUserProfile());
 
+        // Discard menu is only available if at least one raw contact is editable
+        discardMenu.setVisible(mState != null &&
+                mState.getFirstWritableRawContact(mContext) != null);
+
         // help menu depending on whether this is inserting or editing
         if (Intent.ACTION_INSERT.equals(mAction)) {
             // inserting
diff --git a/src/com/android/contacts/quickcontact/QuickContactActivity.java b/src/com/android/contacts/quickcontact/QuickContactActivity.java
index 00ac7ba..adf58bc 100644
--- a/src/com/android/contacts/quickcontact/QuickContactActivity.java
+++ b/src/com/android/contacts/quickcontact/QuickContactActivity.java
@@ -590,12 +590,23 @@
     }
 
     private class PageChangeListener extends SimpleOnPageChangeListener {
+        private int mScrollingState = ViewPager.SCROLL_STATE_IDLE;
+
         @Override
         public void onPageSelected(int position) {
             final CheckableImageView actionView = getActionViewAt(position);
             mTrackScroller.requestChildRectangleOnScreen(actionView,
                     new Rect(0, 0, actionView.getWidth(), actionView.getHeight()), false);
-            renderSelectedRectangle(position, 0);
+            // Don't render rectangle if we are currently scrolling to prevent it from flickering
+            if (mScrollingState == ViewPager.SCROLL_STATE_IDLE) {
+                renderSelectedRectangle(position, 0);
+            }
+        }
+
+        @Override
+        public void onPageScrollStateChanged(int state) {
+            super.onPageScrollStateChanged(state);
+            mScrollingState = state;
         }
 
         @Override