Make long pressing the attach button open the transport popup

// FREEBIE
This commit is contained in:
Sam Lanning 2015-07-26 22:49:43 +01:00 committed by Moxie Marlinspike
parent 745faa12a7
commit 8efe6e7286

View File

@ -892,6 +892,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
composeText.setOnEditorActionListener(sendButtonListener); composeText.setOnEditorActionListener(sendButtonListener);
attachButton.setOnClickListener(new AttachButtonListener()); attachButton.setOnClickListener(new AttachButtonListener());
attachButton.setOnLongClickListener(new AttachButtonLongClickListener());
sendButton.setOnClickListener(sendButtonListener); sendButton.setOnClickListener(sendButtonListener);
sendButton.setEnabled(true); sendButton.setEnabled(true);
sendButton.addOnTransportChangedListener(new OnTransportChangedListener() { 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 { private class ComposeKeyPressedListener implements OnKeyListener, OnClickListener, TextWatcher, OnFocusChangeListener {
int beforeLength; int beforeLength;