1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-02-07 02:30:10 -05:00

when we go into a folder for the first time, jump to the first message being displayed rather than the widget at the end of the list

This commit is contained in:
Jesse Vincent 2009-11-30 04:03:08 +00:00
parent da8ad69366
commit 2c1dad5554

View File

@ -212,6 +212,7 @@ public class MessageList
case MSG_ADD_MESSAGE:
{
boolean wasEmpty = mAdapter.messages.isEmpty();
List<MessageInfoHolder> messages = (List<MessageInfoHolder>)((Object[]) msg.obj)[0];
for (MessageInfoHolder message : messages)
{
@ -224,6 +225,9 @@ public class MessageList
mAdapter.messages.add(index, message);
}
if (wasEmpty)
mListView.setSelection(0);
mAdapter.notifyDataSetChanged();
break;
}