From 8efe6e7286f229202dee5d1ebff1e17a89049acb Mon Sep 17 00:00:00 2001 From: Sam Lanning Date: Sun, 26 Jul 2015 22:49:43 +0100 Subject: [PATCH] Make long pressing the attach button open the transport popup // FREEBIE --- src/org/thoughtcrime/securesms/ConversationActivity.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index 5b0a633cb8..c421f58927 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -892,6 +892,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity composeText.setOnEditorActionListener(sendButtonListener); attachButton.setOnClickListener(new AttachButtonListener()); + attachButton.setOnLongClickListener(new AttachButtonLongClickListener()); sendButton.setOnClickListener(sendButtonListener); sendButton.setEnabled(true); sendButton.addOnTransportChangedListener(new OnTransportChangedListener() { @@ -1401,6 +1402,13 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity } } + private class AttachButtonLongClickListener implements View.OnLongClickListener { + @Override + public boolean onLongClick(View v) { + return sendButton.performLongClick(); + } + } + private class ComposeKeyPressedListener implements OnKeyListener, OnClickListener, TextWatcher, OnFocusChangeListener { int beforeLength;