aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorArtem Shipovskiy <artem0711@gmail.com>2016-03-13 19:06:58 +0500
committerChristian S <christian@pix-art.de>2016-04-09 21:09:56 +0200
commitc49859529cde662c1272c0bc1f8ae8a0004f5f4d (patch)
treeb09c35958b0fffebd18d7539e8b196208904036c /src
parent4d4ec6824b6e49b0e241e5b69d49a89003a27f85 (diff)
Insert /me on long click send button
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java11
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);