[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bubbles click events not being triggered #147

Open
modularthoughts opened this issue Jun 7, 2018 · 1 comment
Open

Bubbles click events not being triggered #147

modularthoughts opened this issue Jun 7, 2018 · 1 comment

Comments

@modularthoughts
Copy link

Neither of the "onClick" events in the bubbles or the icons are being triggered. I tried to put my code as similar as the example you provide, but they're still not working. My original code was:

chatView.setOnBubbleLongClickListener(new Message.OnBubbleLongClickListener() {
            @Override
            public void onLongClick(Message message) {
                Log.d(TAG, "onLongClick() called with: message = [" + message + "]");
                myClipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);

                myClip = ClipData.newPlainText("Mensaje", message.getText());
                myClipboard.setPrimaryClip(myClip);

                Toast.makeText(getApplicationContext(), "Mensaje copiado al portapapeles.",Toast.LENGTH_SHORT).show();
            }
        });

But, even if I just use:

chatView.setOnBubbleLongClickListener(new Message.OnBubbleLongClickListener() {
            @Override
            public void onLongClick(Message message) {
                Log.d(TAG, "onLongClick() called with: message = [" + message + "]");
            }
        });

It still doesn't work.

I am aware of #119 but I'm on version 1.10.0, it should be solved by now. The interesting part is: your example works just fine :/

@alpaltunel
Copy link
alpaltunel commented Aug 10, 2018

It is strange but when I define it seperately it works. how?

OnBubbleLongClickListener listener = new Message.OnBubbleLongClickListener() {
            @Override
            public void onLongClick(Message message) {
                Log.d(TAG, "onLongClick() called with: message = [" + message + "]");
                myClipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);

                myClip = ClipData.newPlainText("Mensaje", message.getText());
                myClipboard.setPrimaryClip(myClip);

                Toast.makeText(getApplicationContext(), "Mensaje copiado al portapapeles.",Toast.LENGTH_SHORT).show();
            }
        };

chatview. setOnBubbleLongClickListener(listener);

worked for me?? I dont know why

maybe after this?

<com.github.bassaer.chatmessageview.view.MessageView
    android:id="@+id/message_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_weight="1"
    app:date_separator_font_size="12sp"
    app:message_font_size="14sp"
    app:message_max_width="250dp"
    app:option_button_enable="false"
    app:text_selectable="false"
    app:time_label_font_size="10sp"
    app:username_font_size="9sp"/>


app:option_button_enable="false"
app:text_selectable="false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants