mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-23 18:02:15 -05:00
Provide a progress indicator while loading remote search results.
This commit is contained in:
parent
218823d7b2
commit
f3084dbb66
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -207,4 +207,6 @@ public class MessagingListener {
|
||||
* {@code false} otherwise.
|
||||
*/
|
||||
public void controllerCommandCompleted(boolean moreCommandsToRun) {}
|
||||
|
||||
public void enableProgressIndicator(boolean enable) { }
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user