diff options
author | Artem Shipovskiy <artem0711@gmail.com> | 2016-03-13 19:06:58 +0500 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2016-04-09 21:09:56 +0200 |
commit | c49859529cde662c1272c0bc1f8ae8a0004f5f4d (patch) | |
tree | b09c35958b0fffebd18d7539e8b196208904036c /src/main/java/eu | |
parent | 4d4ec6824b6e49b0e241e5b69d49a89003a27f85 (diff) |
Insert /me on long click send button
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index ca996b505..6abf76c25 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -320,6 +320,16 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa } } }; + private View.OnLongClickListener mSendButtonLongListener = new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + final String body = mEditMessage.getText().toString(); + if (body.length() == 0) { + mEditMessage.getText().insert(0, "/me "); + } + return true; + } + }; private OnClickListener clickToMuc = new OnClickListener() { @Override @@ -445,6 +455,7 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa mSendButton = (ImageButton) view.findViewById(R.id.textSendButton); mSendButton.setOnClickListener(this.mSendButtonListener); + mSendButton.setOnLongClickListener(this.mSendButtonLongListener); snackbar = (RelativeLayout) view.findViewById(R.id.snackbar); snackbarMessage = (TextView) view.findViewById(R.id.snackbar_message); |