Long press to answer sender

This commit is contained in:
M66B 2021-04-24 20:37:37 +02:00
parent 0ba860be2d
commit 42cfd1ccdc
2 changed files with 16 additions and 3 deletions

1
FAQ.md
View File

@ -1899,6 +1899,7 @@ but even Google's Chrome cannot handle this.
* Did you know that you can long press the trash icons (both in the message and the bottom action bar) to permanently delete a message or conversation? (version 1.1368+)
* Did you know that you can long press the send action to show the send dialog, even if it was disabled?
* Did you know that you can long press the full screen icon to show the original message text only?
* Did you know that you can long press the answer button to reply to the sender? (since version 1.1562)
<br />

View File

@ -936,7 +936,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
fabReply.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onReply();
onReply(false);
}
});
fabReply.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
onReply(true);
return true;
}
});
@ -2366,7 +2374,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
};
private void onReply() {
private void onReply(boolean sender) {
if (values.containsKey("expanded") && values.get("expanded").size() > 0) {
long id = values.get("expanded").get(0);
int pos = adapter.getPositionForKey(id);
@ -2376,7 +2384,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
String selected = (holder == null ? null : holder.getSelectedText());
if (message == null)
return;
onReply(message, selected, fabReply);
if (sender && message.content)
onMenuReply(message, "reply", selected);
else
onReply(message, selected, fabReply);
}
}