Search in sources :

Example 11 with WearableExtender

use of android.support.v4.app.NotificationCompat.WearableExtender 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)

Example 12 with WearableExtender

use of android.support.v4.app.NotificationCompat.WearableExtender in project k-9 by k9mail.

the class WearNotifications method addMarkAllAsReadAction.

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

Example 13 with WearableExtender

use of android.support.v4.app.NotificationCompat.WearableExtender in project k-9 by k9mail.

the class WearNotifications method addDeleteAllAction.

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

Example 14 with WearableExtender

use of android.support.v4.app.NotificationCompat.WearableExtender in project k-9 by k9mail.

the class WearNotifications method addReplyAction.

private void addReplyAction(WearableExtender wearableExtender, NotificationHolder holder) {
    int icon = R.drawable.ic_action_single_message_options_dark;
    String title = context.getString(R.string.notification_action_reply);
    MessageReference messageReference = holder.content.messageReference;
    int notificationId = holder.notificationId;
    PendingIntent action = actionCreator.createReplyPendingIntent(messageReference, notificationId);
    NotificationCompat.Action replyAction = new NotificationCompat.Action.Builder(icon, title, action).build();
    wearableExtender.addAction(replyAction);
}
Also used : NotificationCompat(android.support.v4.app.NotificationCompat) PendingIntent(android.app.PendingIntent) MessageReference(com.fsck.k9.activity.MessageReference)

Example 15 with WearableExtender

use of android.support.v4.app.NotificationCompat.WearableExtender in project k-9 by k9mail.

the class WearNotifications method addMarkAsReadAction.

private void addMarkAsReadAction(WearableExtender wearableExtender, NotificationHolder holder) {
    int icon = R.drawable.ic_action_mark_as_read_dark;
    String title = context.getString(R.string.notification_action_mark_as_read);
    MessageReference messageReference = holder.content.messageReference;
    int notificationId = holder.notificationId;
    PendingIntent action = actionCreator.createMarkMessageAsReadPendingIntent(messageReference, notificationId);
    NotificationCompat.Action markAsReadAction = new NotificationCompat.Action.Builder(icon, title, action).build();
    wearableExtender.addAction(markAsReadAction);
}
Also used : NotificationCompat(android.support.v4.app.NotificationCompat) PendingIntent(android.app.PendingIntent) MessageReference(com.fsck.k9.activity.MessageReference)

Aggregations

NotificationCompat (android.support.v4.app.NotificationCompat)17 PendingIntent (android.app.PendingIntent)12 MessageReference (com.fsck.k9.activity.MessageReference)8 Intent (android.content.Intent)4 WearableExtender (android.support.v4.app.NotificationCompat.WearableExtender)4 Account (com.fsck.k9.Account)4 Notification (android.app.Notification)3 Bitmap (android.graphics.Bitmap)2 RemoteInput (android.support.v4.app.RemoteInput)2 SuppressLint (android.annotation.SuppressLint)1 NotificationManager (android.app.NotificationManager)1 SharedPreferences (android.content.SharedPreferences)1 ApplicationInfo (android.content.pm.ApplicationInfo)1 PackageManager (android.content.pm.PackageManager)1 Paint (android.graphics.Paint)1 PowerManager (android.os.PowerManager)1 NotificationManagerCompat (android.preview.support.v4.app.NotificationManagerCompat)1 StatusBarNotification (android.service.notification.StatusBarNotification)1 BigTextStyle (android.support.v4.app.NotificationCompat.BigTextStyle)1 IOException (java.io.IOException)1