1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-12 12:35:04 -05:00

Provide a progress indicator while loading remote search results.

This commit is contained in:
Joe Steele 2013-01-12 18:02:09 -05:00
parent 218823d7b2
commit f3084dbb66
3 changed files with 13 additions and 0 deletions

View File

@ -804,6 +804,9 @@ public class MessagingController implements Runnable {
threadPool.execute(new Runnable() {
@Override
public void run() {
if (listener != null) {
listener.enableProgressIndicator(true);
}
try {
Store remoteStore = account.getRemoteStore();
LocalStore localStore = account.getLocalStore();
@ -822,6 +825,10 @@ public class MessagingController implements Runnable {
} catch (MessagingException e) {
Log.e(K9.LOG_TAG, "Exception in loadSearchResults: " + e);
addErrorMessage(account, null, e);
} finally {
if (listener != null) {
listener.enableProgressIndicator(false);
}
}
}
});

View File

@ -207,4 +207,6 @@ public class MessagingListener {
* {@code false} otherwise.
*/
public void controllerCommandCompleted(boolean moreCommandsToRun) {}
public void enableProgressIndicator(boolean enable) { }
}

View File

@ -1508,6 +1508,10 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick
mHandler.updateFooter(mContext.getString(R.string.remote_search_sending_query));
}
@Override
public void enableProgressIndicator(boolean enable) {
mHandler.progress(enable);
}
@Override
public void remoteSearchFinished(Account acct, String folder, int numResults, List<Message> extraResults) {