Search in sources :

Example 1 with MessageListFragment

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;
            }
    }
}
Also used : Activity(android.app.Activity) Parcelable(android.os.Parcelable) MessageReference(com.fsck.k9.activity.MessageReference)

Example 2 with MessageListFragment

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);
}
Also used : LocalSearch(com.fsck.k9.search.LocalSearch) MessageListFragment(com.fsck.k9.fragment.MessageListFragment)

Example 3 with MessageListFragment

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);
}
Also used : LocalSearch(com.fsck.k9.search.LocalSearch) MessageListFragment(com.fsck.k9.fragment.MessageListFragment)

Aggregations

MessageListFragment (com.fsck.k9.fragment.MessageListFragment)2 LocalSearch (com.fsck.k9.search.LocalSearch)2 Activity (android.app.Activity)1 Parcelable (android.os.Parcelable)1 MessageReference (com.fsck.k9.activity.MessageReference)1