1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Issue 575

Partially the patch supplied by mpredosin.

Partially restoration of other lost code.
This commit is contained in:
Daniel Applebaum 2009-08-29 22:11:13 +00:00
parent 033632b3ba
commit 8785762986

View File

@ -269,6 +269,17 @@ public class MessageList extends K9ListActivity {
break; break;
} }
case MSG_FOLDER_LOADING:
{
FolderInfoHolder folder = mAdapter.getFolder((String) msg.obj);
if (folder != null)
{
folder.loading = msg.arg1 != 0;
mAdapter.notifyDataSetChanged();
}
break;
}
case MSG_SENDING_OUTBOX: { case MSG_SENDING_OUTBOX: {
boolean sending = (msg.arg1 != 0); boolean sending = (msg.arg1 != 0);
String dispString; String dispString;
@ -399,6 +410,12 @@ public class MessageList extends K9ListActivity {
mListView.setOnItemClickListener(new OnItemClickListener() { mListView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView parent, View v, int itemPosition, long id){ public void onItemClick(AdapterView parent, View v, int itemPosition, long id){
if ((itemPosition+1) == (mAdapter.getCount() )) { if ((itemPosition+1) == (mAdapter.getCount() )) {
MessagingController.getInstance(getApplication()).loadMoreMessages(
mAccount,
mFolderName,
mAdapter.mListener);
onRefresh(FORCE_REMOTE_SYNC); onRefresh(FORCE_REMOTE_SYNC);
return; return;
} else { } else {
@ -1125,6 +1142,34 @@ public class MessageList extends K9ListActivity {
} }
mHandler.progress(true); mHandler.progress(true);
mHandler.folderLoading(folder, true);
mHandler.folderSyncing(folder);
}
@Override
public void synchronizeMailboxFinished(Account account, String folder,
int totalMessagesInMailbox, int numNewMessages) {
if (!account.equals(mAccount) || !folder.equals(mFolderName)) {
return;
}
mHandler.progress(false);
mHandler.folderLoading(folder, false);
mHandler.folderSyncing(null);
}
@Override
public void synchronizeMailboxFailed(Account account, String folder, String message) {
if (!account.equals(mAccount) || !folder.equals(mFolderName)) {
return;
}
Toast.makeText(MessageList.this, message, Toast.LENGTH_LONG).show();
mHandler.progress(false);
mHandler.folderLoading(folder, false);
mHandler.folderSyncing(null);
} }
@Override @Override
@ -1141,25 +1186,6 @@ public class MessageList extends K9ListActivity {
removeMessage(getMessage( message.getUid())); removeMessage(getMessage( message.getUid()));
} }
@Override
public void synchronizeMailboxFinished(Account account, String folder,
int totalMessagesInMailbox, int numNewMessages) {
if (!account.equals(mAccount) || !folder.equals(mFolderName)) {
return;
}
mHandler.progress(false);
}
@Override
public void synchronizeMailboxFailed(Account account, String folder, String message) {
if (!account.equals(mAccount) || !folder.equals(mFolderName)) {
return;
}
Toast.makeText(MessageList.this, message, Toast.LENGTH_LONG).show();
}
@Override @Override
public void listLocalMessagesStarted(Account account, String folder) { public void listLocalMessagesStarted(Account account, String folder) {
if (!account.equals(mAccount)) { if (!account.equals(mAccount)) {