aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-09-04 21:06:22 +0200
committerChristian Schneppe <christian@pix-art.de>2017-09-04 21:06:22 +0200
commitbdc63699f8361247eed7e77e8e7938d56a49ad9d (patch)
treef1ffccc8fa4a6d0d69216e7f4c4584a83c36a5fe /src/main/java/de/pixart/messenger
parent1fbec382597eb9721b79aa5e801fce3a503c1d1f (diff)
NotificationService: add button to mark conversation as read
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index 73d536d1a..5e86ebb91 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -399,6 +399,7 @@ public class NotificationService {
modifyForTextOnly(mBuilder, mUnreadBuilder, messages);
}
RemoteInput remoteInput = new RemoteInput.Builder("text_reply").setLabel(UIHelper.getMessageHint(mXmppConnectionService, conversation)).build();
+ NotificationCompat.Action markReadAction = new NotificationCompat.Action.Builder(R.drawable.ic_send_text_offline, mXmppConnectionService.getResources().getString(R.string.mark_as_read), createReadPendingIntent(conversation)).build();
NotificationCompat.Action replyAction = new NotificationCompat.Action.Builder(R.drawable.ic_send_text_offline, mXmppConnectionService.getResources().getString(R.string.reply), createReplyIntent(conversation, false)).addRemoteInput(remoteInput).build();
NotificationCompat.Action wearReplyAction = new NotificationCompat.Action.Builder(R.drawable.ic_wear_reply, "Reply", createReplyIntent(conversation, true)).addRemoteInput(remoteInput).build();
mBuilder.extend(new NotificationCompat.WearableExtender().addAction(wearReplyAction));
@@ -406,6 +407,7 @@ public class NotificationService {
mUnreadBuilder.setReadPendingIntent(createReadPendingIntent(conversation));
mBuilder.extend(new NotificationCompat.CarExtender().setUnreadConversation(mUnreadBuilder.build()));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+ mBuilder.addAction(markReadAction);
mBuilder.addAction(replyAction);
}
if ((message = getFirstDownloadableMessage(messages)) != null) {