summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJin Cao <jinyan@google.com>2014-08-06 06:35:32 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-08-05 00:34:22 +0000
commit9d4b37f0572a8f876b1cc6d873f9ccf0805dd0e4 (patch)
treeff95dc5a0130132eaadfdab0873efde2cc99760d /src
parent81edb47b20a4ec56c233937217166a9f3cebeb7b (diff)
parentee6766a2c6938dbb4c975d93732d7033eecd90a5 (diff)
downloadandroid_packages_apps_UnifiedEmail-9d4b37f0572a8f876b1cc6d873f9ccf0805dd0e4.tar.gz
android_packages_apps_UnifiedEmail-9d4b37f0572a8f876b1cc6d873f9ccf0805dd0e4.tar.bz2
android_packages_apps_UnifiedEmail-9d4b37f0572a8f876b1cc6d873f9ccf0805dd0e4.zip
Merge "Properly check CursorStatus.ERROR" into ub-gmail-ur14-dev
Diffstat (limited to 'src')
-rw-r--r--src/com/android/mail/browse/ConversationCursor.java4
-rw-r--r--src/com/android/mail/ui/ConversationListFragment.java17
2 files changed, 11 insertions, 10 deletions
diff --git a/src/com/android/mail/browse/ConversationCursor.java b/src/com/android/mail/browse/ConversationCursor.java
index 7f18adf70..6215a1b34 100644
--- a/src/com/android/mail/browse/ConversationCursor.java
+++ b/src/com/android/mail/browse/ConversationCursor.java
@@ -2491,9 +2491,9 @@ public final class ConversationCursor implements Cursor, ConversationCursorOpera
return false;
}
Bundle extras = cursor.getExtras();
- // if no extras, default to LOADING state (so isWaitingForResults check will pass)
final int status = (extras == null) ? UIProvider.CursorStatus.LOADING :
extras.getInt(UIProvider.CursorExtraKeys.EXTRA_STATUS);
- return (cursor.getCount() > 0 || UIProvider.CursorStatus.COMPLETE == status);
+ return (cursor.getCount() > 0 || UIProvider.CursorStatus.ERROR == status ||
+ UIProvider.CursorStatus.COMPLETE == status);
}
}
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 02f73bc45..15a562b7b 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -884,20 +884,21 @@ public final class ConversationListFragment extends ListFragment implements
private void hideLoadingViewAndShowContents() {
final ConversationCursor cursor = getConversationListCursor();
- // Even though cursor might be empty, the list adapter might have teasers. So we check the
- // list adapter count if the cursor is fully/partially loaded.
- if (cursor != null && ConversationCursor.isCursorReadyToShow(cursor) &&
- mListAdapter.getCount() == 0) {
- showEmptyView();
- } else {
- showListView();
- }
final boolean showFooter = mFooterView.updateStatus(cursor);
// Update the sync status bar with sync results if needed
checkSyncStatus();
mListAdapter.setFooterVisibility(showFooter);
mLoadingViewPending = false;
mHandler.removeCallbacks(mLoadingViewRunnable);
+
+ // Even though cursor might be empty, the list adapter might have teasers/footers.
+ // So we check the list adapter count if the cursor is fully/partially loaded.
+ if (cursor != null && ConversationCursor.isCursorReadyToShow(cursor) &&
+ mListAdapter.getCount() == 0) {
+ showEmptyView();
+ } else {
+ showListView();
+ }
}
private void setSwipeAction() {