Search in sources :

Example 1 with MessageViewFragment

use of com.fsck.k9.ui.messageview.MessageViewFragment in project k-9 by k9mail.

the class MessageList method openMessage.

@Override
public void openMessage(MessageReference messageReference) {
    Preferences prefs = Preferences.getPreferences(getApplicationContext());
    Account account = prefs.getAccount(messageReference.getAccountUuid());
    String folderName = messageReference.getFolderName();
    if (folderName.equals(account.getDraftsFolderName())) {
        MessageActions.actionEditDraft(this, messageReference);
    } else {
        mMessageViewContainer.removeView(mMessageViewPlaceHolder);
        if (mMessageListFragment != null) {
            mMessageListFragment.setActiveMessage(messageReference);
        }
        MessageViewFragment fragment = MessageViewFragment.newInstance(messageReference);
        FragmentTransaction ft = getFragmentManager().beginTransaction();
        ft.replace(R.id.message_view_container, fragment);
        mMessageViewFragment = fragment;
        ft.commit();
        if (mDisplayMode != DisplayMode.SPLIT_VIEW) {
            showMessageView();
        }
    }
}
Also used : SearchAccount(com.fsck.k9.search.SearchAccount) Account(com.fsck.k9.Account) FragmentTransaction(android.app.FragmentTransaction) MessageViewFragment(com.fsck.k9.ui.messageview.MessageViewFragment) Preferences(com.fsck.k9.Preferences)

Aggregations

FragmentTransaction (android.app.FragmentTransaction)1 Account (com.fsck.k9.Account)1 Preferences (com.fsck.k9.Preferences)1 SearchAccount (com.fsck.k9.search.SearchAccount)1 MessageViewFragment (com.fsck.k9.ui.messageview.MessageViewFragment)1