show correct tooltip when long pressing start conversations. fixes #2635

This commit is contained in:
Daniel Gultsch 2017-09-19 10:43:25 +02:00
parent 4e864935fe
commit dbd489cbcb

View file

@ -443,24 +443,26 @@ public class ConversationActivity extends XmppActivity
} }
} }
if (Config.supportOmemo()) { if (Config.supportOmemo()) {
new Handler().post(new Runnable() { new Handler().post(addOmemoDebuggerRunnable);
@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());
}
});
}
}
});
} }
return super.onCreateOptionsMenu(menu); 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) { private boolean quickOmemoDebugger(Conversation c) {
if (c != null) { if (c != null) {
boolean single = c.getMode() == Conversation.MODE_SINGLE; boolean single = c.getMode() == Conversation.MODE_SINGLE;