mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-13 21:15:08 -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() {
|
threadPool.execute(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.enableProgressIndicator(true);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
Store remoteStore = account.getRemoteStore();
|
Store remoteStore = account.getRemoteStore();
|
||||||
LocalStore localStore = account.getLocalStore();
|
LocalStore localStore = account.getLocalStore();
|
||||||
@ -822,6 +825,10 @@ public class MessagingController implements Runnable {
|
|||||||
} catch (MessagingException e) {
|
} catch (MessagingException e) {
|
||||||
Log.e(K9.LOG_TAG, "Exception in loadSearchResults: " + e);
|
Log.e(K9.LOG_TAG, "Exception in loadSearchResults: " + e);
|
||||||
addErrorMessage(account, null, e);
|
addErrorMessage(account, null, e);
|
||||||
|
} finally {
|
||||||
|
if (listener != null) {
|
||||||
|
listener.enableProgressIndicator(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -207,4 +207,6 @@ public class MessagingListener {
|
|||||||
* {@code false} otherwise.
|
* {@code false} otherwise.
|
||||||
*/
|
*/
|
||||||
public void controllerCommandCompleted(boolean moreCommandsToRun) {}
|
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));
|
mHandler.updateFooter(mContext.getString(R.string.remote_search_sending_query));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void enableProgressIndicator(boolean enable) {
|
||||||
|
mHandler.progress(enable);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remoteSearchFinished(Account acct, String folder, int numResults, List<Message> extraResults) {
|
public void remoteSearchFinished(Account acct, String folder, int numResults, List<Message> extraResults) {
|
||||||
|
Loading…
Reference in New Issue
Block a user