tap on message_box instead of messageBody to show quick reactions popup

This commit is contained in:
Arne 2024-04-19 12:07:46 +02:00
parent da8f994e91
commit 8090ac0aed

View file

@ -1682,6 +1682,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} }
}); });
} }
// Reactions popup // Reactions popup
ReactionsConfig config = new ReactionsConfigBuilder(activity) ReactionsConfig config = new ReactionsConfigBuilder(activity)
.withReactions(new int[]{ .withReactions(new int[]{
@ -1694,7 +1695,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
}) })
.build(); .build();
ReactionPopup popup = new ReactionPopup(activity, config, (position) -> { ReactionPopup reactionPopup = new ReactionPopup(activity, config, (position) -> {
if (position.equals(0)) { if (position.equals(0)) {
mConversationFragment.setupReply(message[0]); mConversationFragment.setupReply(message[0]);
while (message[0].mergeable(message[0].next())) { while (message[0].mergeable(message[0].next())) {
@ -1820,16 +1821,12 @@ public class MessageAdapter extends ArrayAdapter<Message> {
} }
}); });
// Treat touch-up as click so we don't have to touch twice // Treat touch-up as click so we don't have to touch twice
// (touch twice is because it's waiting to see if you double-touch for text selection) // (touch twice is because it's waiting to see if you double-touch for text selection)
viewHolder.messageBody.setOnTouchListener((v, event) -> { viewHolder.message_box.setOnTouchListener((v, event) -> {
if (event.getAction() == MotionEvent.ACTION_UP) { if (event.getAction() == MotionEvent.ACTION_UP) {
if (MessageAdapter.this.mOnMessageBoxClickedListener != null) { if (MessageAdapter.this.mOnMessageBoxClickedListener != null) {
popup.onTouch(v, event); reactionPopup.onTouch(v, event);
} }
} }
return false; return false;