Merge "Make sure to close popup before orientation changes.." into jb-dev
diff --git a/res/values-sw580dp/styles.xml b/res/values-sw580dp/styles.xml
index 2326d5f..9a54c6f 100644
--- a/res/values-sw580dp/styles.xml
+++ b/res/values-sw580dp/styles.xml
@@ -32,12 +32,11 @@
         <item name="list_item_padding_left">0dip</item>
         <item name="list_item_gap_between_image_and_text">8dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
-        <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">4dip</item>
         <item name="list_item_photo_size">64dip</item>
         <item name="list_item_profile_photo_size">80dip</item>
-        <item name="list_item_prefix_highlight_color">#99cc00</item>
+        <item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
         <item name="list_item_header_text_indent">8dip</item>
         <item name="list_item_header_text_size">14sp</item>
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
@@ -68,7 +67,6 @@
         <item name="list_item_padding_left">0dip</item>
         <item name="list_item_gap_between_image_and_text">8dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
-        <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">18dip</item>
         <item name="list_item_photo_size">64dip</item>
diff --git a/res/values-sw680dp/styles.xml b/res/values-sw680dp/styles.xml
index b7a7700..dce3b7d 100644
--- a/res/values-sw680dp/styles.xml
+++ b/res/values-sw680dp/styles.xml
@@ -32,12 +32,11 @@
         <item name="list_item_padding_left">0dip</item>
         <item name="list_item_gap_between_image_and_text">16dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
-        <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">4dip</item>
         <item name="list_item_photo_size">64dip</item>
         <item name="list_item_profile_photo_size">80dip</item>
-        <item name="list_item_prefix_highlight_color">#99cc00</item>
+        <item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
         <item name="list_item_header_text_indent">8dip</item>
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
         <item name="list_item_header_height">24dip</item>
diff --git a/res/values/attrs.xml b/res/values/attrs.xml
index 4402d05..f49b0bf 100644
--- a/res/values/attrs.xml
+++ b/res/values/attrs.xml
@@ -74,7 +74,6 @@
         <attr name="list_item_padding_left" format="dimension"/>
         <attr name="list_item_gap_between_image_and_text" format="dimension"/>
         <attr name="list_item_gap_between_label_and_data" format="dimension"/>
-        <attr name="list_item_call_button_padding" format="dimension"/>
         <attr name="list_item_vertical_divider_margin" format="dimension"/>
         <attr name="list_item_presence_icon_margin" format="dimension"/>
         <attr name="list_item_presence_icon_size" format="dimension"/>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index f11449c..defd755 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -32,7 +32,6 @@
         <item name="list_item_padding_left">0dip</item>
         <item name="list_item_gap_between_image_and_text">8dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
-        <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">4dip</item>
         <item name="list_item_presence_icon_size">16dip</item>
@@ -145,13 +144,12 @@
         <item name="list_item_padding_left">0dip</item>
         <item name="list_item_gap_between_image_and_text">8dip</item>
         <item name="list_item_gap_between_label_and_data">5dip</item>
-        <item name="list_item_call_button_padding">14dip</item>
         <item name="list_item_vertical_divider_margin">5dip</item>
         <item name="list_item_presence_icon_margin">4dip</item>
         <item name="list_item_presence_icon_size">16dip</item>
         <item name="list_item_photo_size">@dimen/contact_browser_list_item_photo_size</item>
         <item name="list_item_profile_photo_size">70dip</item>
-        <item name="list_item_prefix_highlight_color">#99cc00</item>
+        <item name="list_item_prefix_highlight_color">@color/people_app_theme_color</item>
         <item name="list_item_header_text_color">@color/people_app_theme_color</item>
         <item name="list_item_header_text_size">14sp</item>
         <item name="list_item_header_height">26dip</item>
diff --git a/src/com/android/contacts/editor/ContactEditorFragment.java b/src/com/android/contacts/editor/ContactEditorFragment.java
index 2d61fbc..a18a93f 100644
--- a/src/com/android/contacts/editor/ContactEditorFragment.java
+++ b/src/com/android/contacts/editor/ContactEditorFragment.java
@@ -1397,7 +1397,6 @@
         mAggregationSuggestionPopup.setAnchorView(anchorView);
         mAggregationSuggestionPopup.setWidth(anchorView.getWidth());
         mAggregationSuggestionPopup.setInputMethodMode(ListPopupWindow.INPUT_METHOD_NOT_NEEDED);
-        mAggregationSuggestionPopup.setModal(true);
         mAggregationSuggestionPopup.setAdapter(
                 new AggregationSuggestionAdapter(getActivity(),
                         mState.size() == 1 && mState.get(0).isContactInsert(),
diff --git a/src/com/android/contacts/list/ContactListItemView.java b/src/com/android/contacts/list/ContactListItemView.java
index 8d30c3c..191212b 100644
--- a/src/com/android/contacts/list/ContactListItemView.java
+++ b/src/com/android/contacts/list/ContactListItemView.java
@@ -70,14 +70,11 @@
     private static final int QUICK_CONTACT_BADGE_STYLE =
             com.android.internal.R.attr.quickContactBadgeStyleWindowMedium;
 
-    protected final Context mContext;
-
     // Style values for layout and appearance
     private final int mPreferredHeight;
     private final int mVerticalDividerMargin;
     private final int mGapBetweenImageAndText;
     private final int mGapBetweenLabelAndData;
-    private final int mCallButtonPadding;
     private final int mPresenceIconMargin;
     private final int mPresenceIconSize;
     private final int mHeaderTextColor;
@@ -186,7 +183,6 @@
     // same row.
     private int mLabelAndDataViewMaxHeight;
 
-    private OnClickListener mCallButtonClickListener;
     // TODO: some TextView fields are using CharArrayBuffer while some are not. Determine which is
     // more efficient for each case or in general, and simplify the whole implementation.
     // Note: if we're sure MARQUEE will be used every time, there's no reason to use
@@ -201,7 +197,7 @@
     private Rect mBoundsWithoutHeader = new Rect();
 
     /** A helper used to highlight a prefix in a text field. */
-    private PrefixHighlighter mPrefixHighligher;
+    private PrefixHighlighter mPrefixHighlighter;
     private CharSequence mUnknownNameText;
 
     /**
@@ -244,8 +240,6 @@
                 R.styleable.ContactListItemView_list_item_gap_between_image_and_text, 0);
         mGapBetweenLabelAndData = a.getDimensionPixelOffset(
                 R.styleable.ContactListItemView_list_item_gap_between_label_and_data, 0);
-        mCallButtonPadding = a.getDimensionPixelOffset(
-                R.styleable.ContactListItemView_list_item_call_button_padding, 0);
         mPresenceIconMargin = a.getDimensionPixelOffset(
                 R.styleable.ContactListItemView_list_item_presence_icon_margin, 4);
         mPresenceIconSize = a.getDimensionPixelOffset(
@@ -285,9 +279,9 @@
                 a.getDimensionPixelOffset(
                         R.styleable.ContactListItemView_list_item_padding_bottom, 0));
 
-        mPrefixHighligher = new PrefixHighlighter(
-                a.getColor(R.styleable.ContactListItemView_list_item_prefix_highlight_color,
-                        Color.GREEN));
+        final int prefixHighlightColor = a.getColor(
+                R.styleable.ContactListItemView_list_item_prefix_highlight_color, Color.GREEN);
+        mPrefixHighlighter = new PrefixHighlighter(prefixHighlightColor);
         a.recycle();
 
         a = getContext().obtainStyledAttributes(android.R.styleable.Theme);
@@ -301,13 +295,6 @@
         }
     }
 
-    /**
-     * Installs a call button listener.
-     */
-    public void setOnCallButtonClickListener(OnClickListener callButtonClickListener) {
-        mCallButtonClickListener = callButtonClickListener;
-    }
-
     public void setUnknownNameText(CharSequence unknownNameText) {
         mUnknownNameText = unknownNameText;
     }
@@ -841,7 +828,7 @@
                 mPhotoView = new ImageView(mContext);
             }
             // Quick contact style used above will set a background - remove it
-            mPhotoView.setBackgroundDrawable(null);
+            mPhotoView.setBackground(null);
             addView(mPhotoView);
             mPhotoViewWidthAndHeightAreReady = false;
         }
@@ -1033,7 +1020,7 @@
                 mSnippetView.setVisibility(View.GONE);
             }
         } else {
-            mPrefixHighligher.setText(getSnippetView(), text, mHighlightedPrefix);
+            mPrefixHighlighter.setText(getSnippetView(), text, mHighlightedPrefix);
             mSnippetView.setVisibility(VISIBLE);
         }
     }
@@ -1144,7 +1131,7 @@
     public void showDisplayName(Cursor cursor, int nameColumnIndex, int displayOrder) {
         CharSequence name = cursor.getString(nameColumnIndex);
         if (!TextUtils.isEmpty(name)) {
-            name = mPrefixHighligher.apply(name, mHighlightedPrefix);
+            name = mPrefixHighlighter.apply(name, mHighlightedPrefix);
         } else {
             name = mUnknownNameText;
         }