use of com.fsck.k9.fragment.MessageListFragment in project k-9 by k9mail.
the class MessageListHandler method handleMessage.
@Override
public void handleMessage(android.os.Message msg) {
MessageListFragment fragment = mFragment.get();
if (fragment == null) {
return;
}
// The following messages don't need an attached activity.
switch(msg.what) {
case ACTION_REMOTE_SEARCH_FINISHED:
{
fragment.remoteSearchFinished();
return;
}
}
// Discard messages if the fragment isn't attached to an activity anymore.
Activity activity = fragment.getActivity();
if (activity == null) {
return;
}
switch(msg.what) {
case ACTION_FOLDER_LOADING:
{
String folder = (String) msg.obj;
boolean loading = (msg.arg1 == 1);
fragment.folderLoading(folder, loading);
break;
}
case ACTION_REFRESH_TITLE:
{
fragment.updateTitle();
break;
}
case ACTION_PROGRESS:
{
boolean progress = (msg.arg1 == 1);
fragment.progress(progress);
break;
}
case ACTION_GO_BACK:
{
fragment.fragmentListener.goBack();
break;
}
case ACTION_RESTORE_LIST_POSITION:
{
fragment.listView.onRestoreInstanceState((Parcelable) msg.obj);
break;
}
case ACTION_OPEN_MESSAGE:
{
MessageReference messageReference = (MessageReference) msg.obj;
fragment.fragmentListener.openMessage(messageReference);
break;
}
}
}
use of com.fsck.k9.fragment.MessageListFragment in project k-9 by k9mail.
the class MessageList method showThread.
@Override
public void showThread(Account account, String folderName, long threadRootId) {
showMessageViewPlaceHolder();
LocalSearch tmpSearch = new LocalSearch();
tmpSearch.addAccountUuid(account.getUuid());
tmpSearch.and(SearchField.THREAD_ID, String.valueOf(threadRootId), Attribute.EQUALS);
MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, true, false);
addMessageListFragment(fragment, true);
}
use of com.fsck.k9.fragment.MessageListFragment in project k-9 by k9mail.
the class MessageList method showMoreFromSameSender.
@Override
public void showMoreFromSameSender(String senderAddress) {
LocalSearch tmpSearch = new LocalSearch("From " + senderAddress);
tmpSearch.addAccountUuids(mSearch.getAccountUuids());
tmpSearch.and(SearchField.SENDER, senderAddress, Attribute.CONTAINS);
MessageListFragment fragment = MessageListFragment.newInstance(tmpSearch, false, false);
addMessageListFragment(fragment, true);
}
Aggregations