mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-30 21:52:28 +01:00
Added WearReplyReceiver
This commit is contained in:
committed by
Moxie Marlinspike
parent
69e1252f7f
commit
f0b2cc5590
@@ -36,6 +36,7 @@ import android.support.v4.app.NotificationCompat;
|
||||
import android.support.v4.app.NotificationCompat.Action;
|
||||
import android.support.v4.app.NotificationCompat.BigTextStyle;
|
||||
import android.support.v4.app.NotificationCompat.InboxStyle;
|
||||
import android.support.v4.app.RemoteInput;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.SpannableStringBuilder;
|
||||
@@ -86,6 +87,8 @@ public class MessageNotifier {
|
||||
|
||||
private volatile static long visibleThread = -1;
|
||||
|
||||
public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
|
||||
|
||||
public static void setVisibleThread(long threadId) {
|
||||
visibleThread = threadId;
|
||||
}
|
||||
@@ -222,9 +225,22 @@ public class MessageNotifier {
|
||||
Action markAsReadAction = new Action(R.drawable.check,
|
||||
context.getString(R.string.MessageNotifier_mark_read),
|
||||
notificationState.getMarkAsReadIntent(context, masterSecret));
|
||||
|
||||
Action replyAction = new Action(R.drawable.ic_reply_white_36dp,
|
||||
context.getString(R.string.MessageNotifier_reply),
|
||||
notifications.get(0).getReplyIntent(context));
|
||||
|
||||
Action wearableReplyAction = new Action.Builder(R.drawable.ic_reply,
|
||||
context.getString(R.string.wear_reply_label),
|
||||
notificationState.getReplyIntent(context, masterSecret, recipient.getRecipientId()))
|
||||
.addRemoteInput(new RemoteInput.Builder(EXTRA_VOICE_REPLY).setLabel(context.getString(R.string.wear_reply_label)).build())
|
||||
.build();
|
||||
|
||||
builder.addAction(markAsReadAction);
|
||||
builder.addAction(new Action(R.drawable.ic_reply_white_36dp, context.getString(R.string.MessageNotifier_reply), notifications.get(0).getReplyIntent(context)));
|
||||
builder.extend(new NotificationCompat.WearableExtender().addAction(markAsReadAction));
|
||||
builder.addAction(replyAction);
|
||||
|
||||
builder.extend(new NotificationCompat.WearableExtender().addAction(markAsReadAction)
|
||||
.addAction(wearableReplyAction));
|
||||
}
|
||||
|
||||
SpannableStringBuilder content = new SpannableStringBuilder();
|
||||
|
||||
Reference in New Issue
Block a user