Long press to answer sender

pull/198/head
M66B 4 years ago
parent 0ba860be2d
commit 42cfd1ccdc

@ -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 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 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 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 /> <br />

@ -936,7 +936,15 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
fabReply.setOnClickListener(new View.OnClickListener() { fabReply.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { 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) { if (values.containsKey("expanded") && values.get("expanded").size() > 0) {
long id = values.get("expanded").get(0); long id = values.get("expanded").get(0);
int pos = adapter.getPositionForKey(id); int pos = adapter.getPositionForKey(id);
@ -2376,6 +2384,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
String selected = (holder == null ? null : holder.getSelectedText()); String selected = (holder == null ? null : holder.getSelectedText());
if (message == null) if (message == null)
return; return;
if (sender && message.content)
onMenuReply(message, "reply", selected);
else
onReply(message, selected, fabReply); onReply(message, selected, fabReply);
} }
} }

Loading…
Cancel
Save