~singpolyma/cheogram-android

aad21e0e35f487b8073dd69858fd404fabd59b49 — Stephen Paul Weber a month ago ff818a9 threads
Tap message bubble to set thread
M src/main/java/eu/siacs/conversations/ui/ConversationFragment.java => src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +2 -0
@@ 1250,6 1250,8 @@ public class ConversationFragment extends XmppFragment
                    new EditMessageActionModeCallback(this.binding.textinput));
        }

        messageListAdapter.setOnMessageBoxClicked(message -> setThread(message.getThread()));

        binding.threadIdenticon.setOnClickListener(v -> {
            newThread();
            conversation.setUserSelectedThread(true);

M src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java => src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +17 -0
@@ 108,6 108,7 @@ public class MessageAdapter extends ArrayAdapter<Message> {
    private List<String> highlightedTerm = null;
    private final DisplayMetrics metrics;
    private OnContactPictureClicked mOnContactPictureClickedListener;
    private OnContactPictureClicked mOnMessageBoxClickedListener;
    private OnContactPictureLongClicked mOnContactPictureLongClickedListener;
    private boolean mUseGreenBackground = false;
    private boolean mForceNames = false;


@@ 147,6 148,10 @@ public class MessageAdapter extends ArrayAdapter<Message> {
        this.mOnContactPictureClickedListener = listener;
    }

    public void setOnMessageBoxClicked(OnContactPictureClicked listener) {
        this.mOnMessageBoxClickedListener = listener;
    }

    public Activity getActivity() {
        return activity;
    }


@@ 838,6 843,18 @@ public class MessageAdapter extends ArrayAdapter<Message> {

        resetClickListener(viewHolder.message_box, viewHolder.messageBody);

        viewHolder.message_box.setOnClickListener(v -> {
            if (MessageAdapter.this.mOnMessageBoxClickedListener != null) {
                MessageAdapter.this.mOnMessageBoxClickedListener
                        .onContactPictureClicked(message);
            }
        });
        viewHolder.messageBody.setOnClickListener(v -> {
            if (MessageAdapter.this.mOnMessageBoxClickedListener != null) {
                MessageAdapter.this.mOnMessageBoxClickedListener
                        .onContactPictureClicked(message);
            }
        });
        viewHolder.contact_picture.setOnClickListener(v -> {
            if (MessageAdapter.this.mOnContactPictureClickedListener != null) {
                MessageAdapter.this.mOnContactPictureClickedListener