Search in sources :

Example 36 with MessageReference

use of com.fsck.k9.activity.MessageReference in project k-9 by k9mail.

the class MlfUtils method setLastSelectedFolderName.

static void setLastSelectedFolderName(Preferences preferences, List<MessageReference> messages, String destFolderName) {
    try {
        MessageReference firstMsg = messages.get(0);
        Account account = preferences.getAccount(firstMsg.getAccountUuid());
        LocalFolder firstMsgFolder = MlfUtils.getOpenFolder(firstMsg.getFolderName(), account);
        firstMsgFolder.setLastSelectedFolderName(destFolderName);
    } catch (MessagingException e) {
        Timber.e(e, "Error getting folder for setLastSelectedFolderName()");
    }
}
Also used : LocalFolder(com.fsck.k9.mailstore.LocalFolder) Account(com.fsck.k9.Account) MessagingException(com.fsck.k9.mail.MessagingException) MessageReference(com.fsck.k9.activity.MessageReference)

Example 37 with MessageReference

use of com.fsck.k9.activity.MessageReference in project k-9 by k9mail.

the class DeviceNotifications method addDeleteAction.

private void addDeleteAction(Builder builder, NotificationContent content, int notificationId) {
    if (!isDeleteActionEnabled()) {
        return;
    }
    int icon = getDeleteActionIcon();
    String title = context.getString(R.string.notification_action_delete);
    MessageReference messageReference = content.messageReference;
    PendingIntent action = actionCreator.createDeleteMessagePendingIntent(messageReference, notificationId);
    builder.addAction(icon, title, action);
}
Also used : PendingIntent(android.app.PendingIntent) MessageReference(com.fsck.k9.activity.MessageReference)

Example 38 with MessageReference

use of com.fsck.k9.activity.MessageReference in project k-9 by k9mail.

the class DeviceNotifications method addReplyAction.

private void addReplyAction(Builder builder, NotificationContent content, int notificationId) {
    int icon = getReplyActionIcon();
    String title = context.getString(R.string.notification_action_reply);
    MessageReference messageReference = content.messageReference;
    PendingIntent replyToMessagePendingIntent = actionCreator.createReplyPendingIntent(messageReference, notificationId);
    builder.addAction(icon, title, replyToMessagePendingIntent);
}
Also used : PendingIntent(android.app.PendingIntent) MessageReference(com.fsck.k9.activity.MessageReference)

Example 39 with MessageReference

use of com.fsck.k9.activity.MessageReference in project k-9 by k9mail.

the class WearNotifications method addDeviceReplyAction.

private void addDeviceReplyAction(Builder builder, NotificationHolder holder) {
    int icon = R.drawable.notification_action_mark_as_read;
    String title = context.getString(R.string.notification_action_reply);
    NotificationContent content = holder.content;
    MessageReference messageReference = content.messageReference;
    PendingIntent replyToMessagePendingIntent = actionCreator.createReplyPendingIntent(messageReference, holder.notificationId);
    builder.addAction(icon, title, replyToMessagePendingIntent);
}
Also used : PendingIntent(android.app.PendingIntent) MessageReference(com.fsck.k9.activity.MessageReference)

Example 40 with MessageReference

use of com.fsck.k9.activity.MessageReference in project k-9 by k9mail.

the class WearNotifications method addArchiveAllAction.

private void addArchiveAllAction(WearableExtender wearableExtender, NotificationData notificationData) {
    int icon = R.drawable.ic_action_archive_dark;
    String title = context.getString(R.string.notification_action_archive_all);
    Account account = notificationData.getAccount();
    ArrayList<MessageReference> messageReferences = notificationData.getAllMessageReferences();
    int notificationId = NotificationIds.getNewMailSummaryNotificationId(account);
    PendingIntent action = actionCreator.createArchiveAllPendingIntent(account, messageReferences, notificationId);
    NotificationCompat.Action archiveAction = new NotificationCompat.Action.Builder(icon, title, action).build();
    wearableExtender.addAction(archiveAction);
}
Also used : Account(com.fsck.k9.Account) NotificationCompat(android.support.v4.app.NotificationCompat) PendingIntent(android.app.PendingIntent) MessageReference(com.fsck.k9.activity.MessageReference)

Aggregations

MessageReference (com.fsck.k9.activity.MessageReference)54 PendingIntent (android.app.PendingIntent)25 Account (com.fsck.k9.Account)18 Test (org.junit.Test)14 NotificationCompat (android.support.v4.app.NotificationCompat)9 ArrayList (java.util.ArrayList)9 Notification (android.app.Notification)8 LocalMessage (com.fsck.k9.mailstore.LocalMessage)8 List (java.util.List)7 HashMap (java.util.HashMap)5 SearchAccount (com.fsck.k9.search.SearchAccount)4 Cursor (android.database.Cursor)3 Preferences (com.fsck.k9.Preferences)3 MessagingException (com.fsck.k9.mail.MessagingException)3 LocalFolder (com.fsck.k9.mailstore.LocalFolder)3 LinkedList (java.util.LinkedList)3 Map (java.util.Map)3 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 Message (com.fsck.k9.mail.Message)2