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

MessageListAdapter addToStart method always add message on top of chat (instead of bottom of list) #352

Open
bipinvaylu opened this issue Apr 15, 2021 · 1 comment

Comments

@bipinvaylu
Copy link

bipinvaylu commented Apr 15, 2021

Currently, I am using this library. There is no doubt that its nice library. But I am not sure why (probably) for me only addToStart method add new message in top of the list, instead of bottom of the list. addToEnd(msgList, reverse:true) is working fine. Here, I am adding my my app code related to this and related screen shot.

Code

private fun renderSBMessageState(state: SBMessageState) {
        when (state) {
            is SBMessageState.Loaded -> {
                messageListAdapter.addToEnd(state.messageList, true)
                chatConnectionManagerViewModel.getCurrentSBGroupChannel()?.groupChannel?.markAsRead()
            }

            is SBMessageState.OnNewMessage -> {
                messageListAdapter.addToStart(state.message, true)
            }
}

Chat screeshot:

image

@stfalcon Am i missing something here to setting up? Can you please help me here to figure out this.

Thanks

@Bastosss77
Copy link

Up ! Is somebody succeed to figure it out ? I'm struggling with this problem too

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