diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-09-06 12:13:50 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-09-07 20:19:46 +0200 |
commit | e8af2325528e1d887d2e1325e3c5f4745526a3d4 (patch) | |
tree | 322bcd8f62777a6bed93aa097514e1c29161e7cb /src/main/java/de | |
parent | 35c8b36e70936563b053ba4bf43e1d794bc86e2b (diff) |
show reply action on wear devices
Diffstat (limited to 'src/main/java/de')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/NotificationService.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java index 1790db201..62ca32ced 100644 --- a/src/main/java/de/pixart/messenger/services/NotificationService.java +++ b/src/main/java/de/pixart/messenger/services/NotificationService.java @@ -332,10 +332,12 @@ public class NotificationService { } else { modifyForTextOnly(mBuilder, messages); } + RemoteInput remoteInput = new RemoteInput.Builder("text_reply").setLabel(UIHelper.getMessageHint(mXmppConnectionService, conversation)).build(); + NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_send_text_offline, "Reply", createReplyIntent(conversation)).addRemoteInput(remoteInput).build(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - RemoteInput remoteInput = new RemoteInput.Builder("text_reply").setLabel(UIHelper.getMessageHint(mXmppConnectionService, conversation)).build(); - NotificationCompat.Action action = new NotificationCompat.Action.Builder(R.drawable.ic_send_text_offline, "Reply", createReplyIntent(conversation)).addRemoteInput(remoteInput).build(); mBuilder.addAction(action); + } else { + mBuilder.extend(new NotificationCompat.WearableExtender().addAction(action)); } if ((message = getFirstDownloadableMessage(messages)) != null) { mBuilder.addAction( |