am 567f6456: am d5c5e621: Merge "Rather than change the text, just remove the waiting for entries row." into jb-dev

* commit '567f6456143d519bc5f0c7818a81c63f3dcd9413':
  Rather than change the text, just remove the waiting for entries row.
diff --git a/chips/res/layout/chips_waiting_for_directory_search.xml b/chips/res/layout/chips_waiting_for_directory_search.xml
deleted file mode 100644
index 5ed1ec2..0000000
--- a/chips/res/layout/chips_waiting_for_directory_search.xml
+++ /dev/null
@@ -1,46 +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="wrap_content"
-    android:minHeight="48dip"
-    android:orientation="horizontal"
-    android:layout_centerVertical="true"
-    android:layout_gravity="center_vertical">
-    <ProgressBar android:id="@+id/progress_circular"
-        style="?android:attr/progressBarStyle"
-        android:indeterminate="true"
-        android:layout_centerVertical="true"
-        android:layout_alignParentLeft="true"
-        android:layout_marginLeft="8dip"
-        android:layout_marginRight="8dip"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content" />
-    <TextView android:id="@+id/text1"
-        android:textColor="?android:attr/textColorSecondary"
-        android:textAppearance="?android:attr/textAppearanceMedium"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_toRightOf="@id/progress_circular"
-        android:layout_centerVertical="true"
-        android:gravity="center_vertical"
-        android:paddingLeft="6dip"
-        android:singleLine="true"
-        android:ellipsize="end"
-        android:text="@string/chips_waiting_for_directory_result"
-        />
-</RelativeLayout>
diff --git a/chips/res/values/strings.xml b/chips/res/values/strings.xml
index f67d440..f743ae3 100644
--- a/chips/res/values/strings.xml
+++ b/chips/res/values/strings.xml
@@ -17,9 +17,6 @@
     <!-- Text displayed when the recipientedittextview is not focused. Displays the total number of recipients since the field is shrunk to just display a portion -->
     <string name="more_string"><xliff:g id="count">%1$s</xliff:g> more...</string>
 
-    <!-- Text displayed when there are remote directories not returning results.
-         [CHAR LIMIT=50] -->
-    <string name="chips_waiting_for_directory_result">Waiting for more contacts</string>
     <!-- Text displayed when the user long presses on a chip to copy the recipients email address.
          [CHAR LIMIT=200] -->
     <string name="copy_email">Copy email address</string>
diff --git a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java
index a0ebd7f..2e1491a 100644
--- a/chips/src/com/android/ex/chips/BaseRecipientAdapter.java
+++ b/chips/src/com/android/ex/chips/BaseRecipientAdapter.java
@@ -685,10 +685,6 @@
             }
         }
 
-        if (showMessageIfDirectoryLoadRemaining && mRemainingDirectoryCount > 0) {
-            entries.add(RecipientEntry.WAITING_FOR_DIRECTORY_SEARCH);
-        }
-
         return entries;
     }
 
@@ -834,71 +830,59 @@
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
         final RecipientEntry entry = mEntries.get(position);
-        switch (entry.getEntryType()) {
-            case RecipientEntry.ENTRY_TYPE_WAITING_FOR_DIRECTORY_SEARCH: {
-                return convertView != null ? convertView
-                        : mInflater.inflate(getWaitingForDirectorySearchLayout(), parent, false);
-            }
-            default: {
-                String displayName = entry.getDisplayName();
-                String destination = entry.getDestination();
-                if (TextUtils.isEmpty(displayName)
-                        || TextUtils.equals(displayName, destination)) {
-                    displayName = destination;
+        String displayName = entry.getDisplayName();
+        String destination = entry.getDestination();
+        if (TextUtils.isEmpty(displayName) || TextUtils.equals(displayName, destination)) {
+            displayName = destination;
 
-                    // We only show the destination for secondary entries, so clear it only for
-                    // the first level.
-                    if (entry.isFirstLevel()) {
-                        destination = null;
-                    }
-                }
-
-                final View itemView = convertView != null ? convertView
-                        : mInflater.inflate(getItemLayout(), parent, false);
-                final TextView displayNameView =
-                        (TextView) itemView.findViewById(getDisplayNameId());
-                final TextView destinationView =
-                        (TextView) itemView.findViewById(getDestinationId());
-                final TextView destinationTypeView =
-                        (TextView) itemView.findViewById(getDestinationTypeId());
-                final ImageView imageView = (ImageView)itemView.findViewById(getPhotoId());
-                displayNameView.setText(displayName);
-                if (!TextUtils.isEmpty(destination)) {
-                    destinationView.setText(destination);
-                } else {
-                    destinationView.setText(null);
-                }
-                if (destinationTypeView != null) {
-                    final CharSequence destinationType = mQuery.getTypeLabel(
-                            mContext.getResources(),
-                            entry.getDestinationType(),
-                            entry.getDestinationLabel()).toString().toUpperCase();
-
-                    destinationTypeView.setText(destinationType);
-                }
-
-                if (entry.isFirstLevel()) {
-                    displayNameView.setVisibility(View.VISIBLE);
-                    if (imageView != null) {
-                        imageView.setVisibility(View.VISIBLE);
-                        final byte[] photoBytes = entry.getPhotoBytes();
-                        if (photoBytes != null && imageView != null) {
-                            final Bitmap photo = BitmapFactory.decodeByteArray(
-                                    photoBytes, 0, photoBytes.length);
-                            imageView.setImageBitmap(photo);
-                        } else {
-                            imageView.setImageResource(getDefaultPhotoResource());
-                        }
-                    }
-                } else {
-                    displayNameView.setVisibility(View.GONE);
-                    if (imageView != null) {
-                        imageView.setVisibility(View.INVISIBLE);
-                    }
-                }
-                return itemView;
+            // We only show the destination for secondary entries, so clear it
+            // only for the first level.
+            if (entry.isFirstLevel()) {
+                destination = null;
             }
         }
+
+        final View itemView = convertView != null ? convertView : mInflater.inflate(
+                getItemLayout(), parent, false);
+        final TextView displayNameView = (TextView) itemView.findViewById(getDisplayNameId());
+        final TextView destinationView = (TextView) itemView.findViewById(getDestinationId());
+        final TextView destinationTypeView = (TextView) itemView
+                .findViewById(getDestinationTypeId());
+        final ImageView imageView = (ImageView) itemView.findViewById(getPhotoId());
+        displayNameView.setText(displayName);
+        if (!TextUtils.isEmpty(destination)) {
+            destinationView.setText(destination);
+        } else {
+            destinationView.setText(null);
+        }
+        if (destinationTypeView != null) {
+            final CharSequence destinationType = mQuery
+                    .getTypeLabel(mContext.getResources(), entry.getDestinationType(),
+                            entry.getDestinationLabel()).toString().toUpperCase();
+
+            destinationTypeView.setText(destinationType);
+        }
+
+        if (entry.isFirstLevel()) {
+            displayNameView.setVisibility(View.VISIBLE);
+            if (imageView != null) {
+                imageView.setVisibility(View.VISIBLE);
+                final byte[] photoBytes = entry.getPhotoBytes();
+                if (photoBytes != null && imageView != null) {
+                    final Bitmap photo = BitmapFactory.decodeByteArray(photoBytes, 0,
+                            photoBytes.length);
+                    imageView.setImageBitmap(photo);
+                } else {
+                    imageView.setImageResource(getDefaultPhotoResource());
+                }
+            }
+        } else {
+            displayNameView.setVisibility(View.GONE);
+            if (imageView != null) {
+                imageView.setVisibility(View.INVISIBLE);
+            }
+        }
+        return itemView;
     }
 
     /**
@@ -913,13 +897,6 @@
     }
 
     /**
-     * Returns a layout id for a view showing "waiting for more contacts".
-     */
-    protected int getWaitingForDirectorySearchLayout() {
-        return R.layout.chips_waiting_for_directory_search;
-    }
-
-    /**
      * Returns a resource ID representing an image which should be shown when ther's no relevant
      * photo is available.
      */
diff --git a/chips/src/com/android/ex/chips/RecipientEntry.java b/chips/src/com/android/ex/chips/RecipientEntry.java
index 4f22142..0448229 100644
--- a/chips/src/com/android/ex/chips/RecipientEntry.java
+++ b/chips/src/com/android/ex/chips/RecipientEntry.java
@@ -36,12 +36,8 @@
     /* package */ static final int INVALID_DESTINATION_TYPE = -1;
 
     public static final int ENTRY_TYPE_PERSON = 0;
-    public static final int ENTRY_TYPE_WAITING_FOR_DIRECTORY_SEARCH = 1;
 
-    public static final int ENTRY_TYPE_SIZE = 2;
-
-    public static final RecipientEntry WAITING_FOR_DIRECTORY_SEARCH =
-            new RecipientEntry(ENTRY_TYPE_WAITING_FOR_DIRECTORY_SEARCH);
+    public static final int ENTRY_TYPE_SIZE = 1;
 
     private final int mEntryType;