diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-09-19 19:50:22 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-09-19 19:50:22 +0200 |
commit | 93b3596ab17c8f655a81892faa4d56c03014d2ad (patch) | |
tree | b154bdefb24047597b13a7edd4f3dc0b8fcb4530 /src/main/java/de/pixart/messenger/ui | |
parent | 5dddcb32ef11d57fc0bb6f4476e360d414849394 (diff) |
show correct tooltip when long pressing start conversations
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationActivity.java | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java index ef864669d..f4c66fbb8 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationActivity.java @@ -573,24 +573,26 @@ public class ConversationActivity extends XmppActivity } } if (Config.supportOmemo()) { - new Handler().post(new Runnable() { - @Override - public void run() { - View view = findViewById(R.id.action_security); - if (view != null) { - view.setOnLongClickListener(new View.OnLongClickListener() { - @Override - public boolean onLongClick(View v) { - return quickOmemoDebugger(getSelectedConversation()); - } - }); - } - } - }); + new Handler().post(addOmemoDebuggerRunnable); } return super.onCreateOptionsMenu(menu); } + private Runnable addOmemoDebuggerRunnable = new Runnable() { + @Override + public void run() { + View view = findViewById(R.id.action_security); + if (view != null) { + view.setOnLongClickListener(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + return v.getId() == R.id.action_security && quickOmemoDebugger(getSelectedConversation()); + } + }); + } + } + }; + private boolean quickOmemoDebugger(Conversation c) { if (c != null) { boolean single = c.getMode() == Conversation.MODE_SINGLE; |