Merge "Fix progress dialog progress bar"
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index 31415e5..358bb31 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -686,11 +686,17 @@
if (data != null) {
data.moveToFirst();
Folder folder = new Folder(data);
- if (folder.isSyncInProgress()) {
- mActionBarView.onRefreshStarted();
+ if (mConvListContext.isSearchResult()) {
+ if (mConversationListFragment != null) {
+ mConversationListFragment.onSearchFolderUpdated(folder);
+ }
} else {
- // Stop the spinner here.
- mActionBarView.onRefreshStopped(folder.lastSyncResult);
+ if (folder.isSyncInProgress()) {
+ mActionBarView.onRefreshStarted();
+ } else {
+ // Stop the spinner here.
+ mActionBarView.onRefreshStopped(folder.lastSyncResult);
+ }
}
LogUtils.v(LOG_TAG, "FOLDER STATUS = " + folder.syncStatus);
}
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 54c7874..0badd7b 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -526,7 +526,6 @@
}
mListAdapter.swapCursor(mConversationListCursor);
mConversationListCursor.addListener(this);
- updateSearchResultHeader(data != null ? data.getCount() : 0);
if (mActivity.shouldShowFirstConversation()) {
if (mConversationListCursor.getCount() > 0) {
mConversationListCursor.moveToPosition(0);
@@ -540,4 +539,13 @@
public void onLoaderReset(Loader<ConversationCursor> loader) {
// Do nothing.
}
+
+ public void onSearchFolderUpdated(Folder folder) {
+ mFolder = folder;
+ // Check the status of the folder to see if we are done loading.
+ if (!mFolder.isSyncInProgress()
+ && mFolder.lastSyncResult == UIProvider.LastSyncResult.SUCCESS) {
+ updateSearchResultHeader(mFolder != null ? mFolder.totalCount : 0);
+ }
+ }
}