1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -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

@ -268,6 +268,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);
@ -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,21 +1142,11 @@ public class MessageList extends K9ListActivity {
} }
mHandler.progress(true); mHandler.progress(true);
mHandler.folderLoading(folder, true);
mHandler.folderSyncing(folder);
} }
@Override
public void synchronizeMailboxNewMessage(Account account, String folder, Message message) {
if (!account.equals(mAccount) || !folder.equals(mFolderName)) {
return;
}
addOrUpdateMessage(folder, message, true, true);
}
@Override
public void synchronizeMailboxRemovedMessage(Account account, String folder,Message message) {
removeMessage(getMessage( message.getUid()));
}
@Override @Override
public void synchronizeMailboxFinished(Account account, String folder, public void synchronizeMailboxFinished(Account account, String folder,
@ -1149,6 +1156,8 @@ public class MessageList extends K9ListActivity {
} }
mHandler.progress(false); mHandler.progress(false);
mHandler.folderLoading(folder, false);
mHandler.folderSyncing(null);
} }
@Override @Override
@ -1158,6 +1167,23 @@ public class MessageList extends K9ListActivity {
} }
Toast.makeText(MessageList.this, message, Toast.LENGTH_LONG).show(); Toast.makeText(MessageList.this, message, Toast.LENGTH_LONG).show();
mHandler.progress(false);
mHandler.folderLoading(folder, false);
mHandler.folderSyncing(null);
}
@Override
public void synchronizeMailboxNewMessage(Account account, String folder, Message message) {
if (!account.equals(mAccount) || !folder.equals(mFolderName)) {
return;
}
addOrUpdateMessage(folder, message, true, true);
}
@Override
public void synchronizeMailboxRemovedMessage(Account account, String folder,Message message) {
removeMessage(getMessage( message.getUid()));
} }
@Override @Override