Disable quick reply for now

This commit is contained in:
Niels Andriesse 2019-07-25 10:40:57 +10:00
parent 16c89178f2
commit a3a757c3ef
2 changed files with 12 additions and 8 deletions

View File

@ -37,12 +37,10 @@ import android.support.annotation.NonNull;
import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat;
import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationManagerCompat;
import android.text.TextUtils; import android.text.TextUtils;
import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.conversation.ConversationActivity;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.contactshare.ContactUtil;
import org.thoughtcrime.securesms.contactshare.Contact; import org.thoughtcrime.securesms.contactshare.Contact;
import org.thoughtcrime.securesms.contactshare.ContactUtil;
import org.thoughtcrime.securesms.conversation.ConversationActivity;
import org.thoughtcrime.securesms.database.DatabaseFactory; import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo; import org.thoughtcrime.securesms.database.MessagingDatabase.MarkedMessageInfo;
import org.thoughtcrime.securesms.database.MmsSmsDatabase; import org.thoughtcrime.securesms.database.MmsSmsDatabase;
@ -50,6 +48,7 @@ import org.thoughtcrime.securesms.database.ThreadDatabase;
import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord; import org.thoughtcrime.securesms.database.model.MediaMmsMessageRecord;
import org.thoughtcrime.securesms.database.model.MessageRecord; import org.thoughtcrime.securesms.database.model.MessageRecord;
import org.thoughtcrime.securesms.database.model.MmsMessageRecord; import org.thoughtcrime.securesms.database.model.MmsMessageRecord;
import org.thoughtcrime.securesms.logging.Log;
import org.thoughtcrime.securesms.mms.SlideDeck; import org.thoughtcrime.securesms.mms.SlideDeck;
import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.recipients.Recipient;
import org.thoughtcrime.securesms.service.IncomingMessageObserver; import org.thoughtcrime.securesms.service.IncomingMessageObserver;
@ -70,6 +69,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import me.leolin.shortcutbadger.ShortcutBadger; import me.leolin.shortcutbadger.ShortcutBadger;
import network.loki.messenger.R;
/** /**
@ -318,7 +318,7 @@ public class MessageNotifier {
ReplyMethod replyMethod = ReplyMethod.forRecipient(context, recipient); ReplyMethod replyMethod = ReplyMethod.forRecipient(context, recipient);
builder.addActions(notificationState.getMarkAsReadIntent(context, notificationId), builder.addActions(notificationState.getMarkAsReadIntent(context, notificationId),
notificationState.getQuickReplyIntent(context, notifications.get(0).getRecipient()), /*notificationState.getQuickReplyIntent(context, notifications.get(0).getRecipient()),*/
notificationState.getRemoteReplyIntent(context, notifications.get(0).getRecipient(), replyMethod), notificationState.getRemoteReplyIntent(context, notifications.get(0).getRecipient(), replyMethod),
replyMethod); replyMethod);

View File

@ -17,7 +17,6 @@ import android.text.SpannableStringBuilder;
import com.bumptech.glide.load.engine.DiskCacheStrategy; import com.bumptech.glide.load.engine.DiskCacheStrategy;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.contacts.avatars.ContactColors; import org.thoughtcrime.securesms.contacts.avatars.ContactColors;
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto; import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto; import org.thoughtcrime.securesms.contacts.avatars.FallbackContactPhoto;
@ -37,6 +36,8 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import network.loki.messenger.R;
public class SingleRecipientNotificationBuilder extends AbstractNotificationBuilder { public class SingleRecipientNotificationBuilder extends AbstractNotificationBuilder {
private static final String TAG = SingleRecipientNotificationBuilder.class.getSimpleName(); private static final String TAG = SingleRecipientNotificationBuilder.class.getSimpleName();
@ -143,7 +144,6 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
} }
public void addActions(@NonNull PendingIntent markReadIntent, public void addActions(@NonNull PendingIntent markReadIntent,
@NonNull PendingIntent quickReplyIntent,
@NonNull PendingIntent wearableReplyIntent, @NonNull PendingIntent wearableReplyIntent,
@NonNull ReplyMethod replyMethod) @NonNull ReplyMethod replyMethod)
{ {
@ -154,17 +154,21 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
String actionName = context.getString(R.string.MessageNotifier_reply); String actionName = context.getString(R.string.MessageNotifier_reply);
String label = context.getString(replyMethodLongDescription(replyMethod)); String label = context.getString(replyMethodLongDescription(replyMethod));
/*
Action replyAction = new Action(R.drawable.ic_reply_white_36dp, Action replyAction = new Action(R.drawable.ic_reply_white_36dp,
actionName, actionName,
quickReplyIntent); quickReplyIntent);
*/
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
/*
replyAction = new Action.Builder(R.drawable.ic_reply_white_36dp, replyAction = new Action.Builder(R.drawable.ic_reply_white_36dp,
actionName, actionName,
wearableReplyIntent) wearableReplyIntent)
.addRemoteInput(new RemoteInput.Builder(MessageNotifier.EXTRA_REMOTE_REPLY) .addRemoteInput(new RemoteInput.Builder(MessageNotifier.EXTRA_REMOTE_REPLY)
.setLabel(label).build()) .setLabel(label).build())
.build(); .build();
*/
} }
Action wearableReplyAction = new Action.Builder(R.drawable.ic_reply, Action wearableReplyAction = new Action.Builder(R.drawable.ic_reply,
@ -175,7 +179,7 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
.build(); .build();
addAction(markAsReadAction); addAction(markAsReadAction);
addAction(replyAction); // addAction(replyAction);
extend(new NotificationCompat.WearableExtender().addAction(markAsReadAction) extend(new NotificationCompat.WearableExtender().addAction(markAsReadAction)
.addAction(wearableReplyAction)); .addAction(wearableReplyAction));