timigod / android-chat-ui

A messages UI library for Android
Apache License 2.0
240 stars 102 forks source link

Received Messages filling entire width and not round like sent ones #16

Closed rutura closed 6 years ago

rutura commented 6 years ago

Screen below image

mohan083 commented 6 years ago

I am having the same issue.

MichaelObi commented 6 years ago

I'm going to try to reproduce this now. I'll ask if I need more information to do that.

luciovinicius commented 6 years ago

any solutions? same here

andkishor commented 6 years ago

Any updates on it?

mattplindsay commented 6 years ago

I receive the same issue - has anyone worked out why?

samuelo-101 commented 6 years ago

Had this issue but was able to workaround it by adding the following attribute to the ChatView in my XML layout: chatview:bubbleBackgroundRcv="#SomeHexCode"

However, the bubble background is black for received messages, even though I have explicitly set it to another color. screenshot

mattplindsay commented 6 years ago

Thanks for that answer. Unfortunately that didn't work for me. I was using the following code: <co.intentservice.chatui.ChatView android:id="@+id/my_chat_view" android:layout_width="match_parent" android:layout_height="match_parent" chatview:bubbleBackgroundRcv="#ffffff" />

samuelo-101 commented 6 years ago

@mattplindsay Haven't gone through the code to see exactly what might be causing the issue, but perhaps a combination of attributes might work. This is what I have in place: <co.intentservice.chatui.ChatView android:id="@+id/chatView" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" chatview:backgroundColor="@color/white" chatview:bubbleBackgroundRcv="@color/white" chatview:bubbleBackgroundSend="@color/white" chatview:bubbleElevation="elevated" chatview:inputBackgroundColor="@color/white" chatview:inputHintColor="@color/grey" chatview:inputTextColor="@color/textColor" chatview:sendBtnBackgroundTint="@color/colorPrimary" chatview:sendBtnIconTint="@color/white" />

mattplindsay commented 6 years ago

Yes, I have fixed the 'full width' problem by fixing a typo I had in: xmlns:chatview="http://schemas.android.com/apk/res-auto"

But I still that the same issue as you in that: chatview:bubbleBackgroundRcv="@color/white"

Still doesn't do anything (my bubbles are still black) - but at least it;s better

samuelo-101 commented 6 years ago

@mattplindsay I cloned the project and discovered a posible bug in the View Holder class co.intentservice.chatui.viewholders. MessageViewHolder line 72:

messageView.setBackgroundColor(background); should actually be messageView.setBackground(background); to have any effect on the bubble.

setBackgroundColor calls the View superclass, which will ultimately change the background color of the row, but to have an effect on the bubble, setBackground should be called instead. Tested with chatview:bubbleBackgroundRcv="#4CAF50"

If anyone else can validate this, please do. I will branch and create a pull request ASAP. See attached screenshot: screen

samuelo-101 commented 6 years ago

@timigod @MichaelObi Hi. I've opened a pull request with respect to this issue. Kindly review when possible. Thanks. https://github.com/timigod/android-chat-ui/pull/22/commits

MichaelObi commented 6 years ago

The issues here have been addressed by PR #22.

Closing this now.