OSDN Git Service

Display empty text when there are no contacts visible.
authorEvan Millar <emillar@google.com>
Tue, 6 Oct 2009 20:34:15 +0000 (13:34 -0700)
committerEvan Millar <emillar@google.com>
Tue, 6 Oct 2009 22:53:39 +0000 (15:53 -0700)
-bc triaged bug: http://b/issue?id=2162934

Change-Id: I331918d70282bb2e123da22bc940168c41406326

src/com/android/contacts/ContactsListActivity.java

index 78ab07e..0dcfc53 100644 (file)
@@ -2723,7 +2723,9 @@ public class ContactsListActivity extends ListActivity implements
                 return 0;
             }
             int superCount = super.getCount();
-            if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0) {
+            if ((mMode & MODE_MASK_SHOW_NUMBER_OF_CONTACTS) != 0 && superCount > 0) {
+                // We don't want to count this header if it's the only thing visible, so that
+                // the empty text will display.
                 superCount++;
             }
             if (mSuggestionsCursorCount != 0) {