Clean up swipe logic

This commit is contained in:
Arne 2024-12-09 23:18:39 +01:00
parent fd6577b869
commit 9434f31915
2 changed files with 2 additions and 13 deletions

View file

@ -1789,10 +1789,6 @@ public class ConversationFragment extends XmppFragment
// if (conversation.getMode() == Conversational.MODE_SINGLE || conversation.getMucOptions().participating()) addReaction(message);
});
messageListAdapter.setOnMessageBoxSwiped(message -> {
quoteMessage(message);
});
binding.threadIdenticonLayout.setOnClickListener(v -> {
boolean wasLocked = conversation.getLockThread();
conversation.setLockThread(false);
@ -2026,7 +2022,6 @@ public class ConversationFragment extends XmppFragment
messageListAdapter.setOnInlineImageLongClicked(null);
messageListAdapter.setConversationFragment(null);
messageListAdapter.setOnMessageBoxClicked(null);
messageListAdapter.setOnMessageBoxSwiped(null);
binding.conversationViewPager.setAdapter(null);
if (conversation != null) conversation.setupViewPager(null, null, false, null);
}
@ -2070,7 +2065,7 @@ public class ConversationFragment extends XmppFragment
return false;
}
private void setupReply(Message message) {
public void setupReply(Message message) {
conversation.setReplyTo(message);
if (message == null) {
binding.contextPreview.setVisibility(View.GONE);

View file

@ -167,7 +167,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
private ConversationFragment mConversationFragment = null;
private OnContactPictureClicked mOnContactPictureClickedListener;
private OnContactPictureClicked mOnMessageBoxClickedListener;
private OnContactPictureClicked mOnMessageBoxSwipedListener;
private OnContactPictureLongClicked mOnContactPictureLongClickedListener;
private OnInlineImageLongClicked mOnInlineImageLongClickedListener;
private boolean mUseGreenBackground = false;
@ -218,10 +217,6 @@ public class MessageAdapter extends ArrayAdapter<Message> {
this.mOnMessageBoxClickedListener = listener;
}
public void setOnMessageBoxSwiped(OnContactPictureClicked listener) {
this.mOnMessageBoxSwipedListener = listener;
}
public void setConversationFragment(ConversationFragment frag) {
mConversationFragment = frag;
}
@ -1309,8 +1304,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
public void onOpen(SwipeLayout layout) {
swipeLayout.refreshDrawableState();
//when the BottomView totally show.
if (mOnMessageBoxSwipedListener != null)
mOnMessageBoxSwipedListener.onContactPictureClicked(message);
mConversationFragment.setupReply(message);
swipeLayout.close(true);
swipeLayout.setClickToClose(true);
}