stfalcon-studio / ChatKit

Android library. Flexible components for chat UI implementation with flexible possibilities for styling, customizing and data management. Made by Stfalcon
http://stfalcon.com
Apache License 2.0
3.68k stars 831 forks source link

Send new message performance #172

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi

When I a send new message, I listen to "onSubmit" event, and then I do the next code: adapter.addToStart(message, true);

but it takes time (2 seocnds) till I see the message in messages list, is there any way to make the message appear right away?

thanks

ghost commented 6 years ago

I solved it:

when adding the message to adapter I called the Pusher chatkit library with seperate thread:

      Thread thread = new Thread(new Runnable() {
                @Override
                public void run() {
                    ChatkitManager.getInstance().sendMessage(roomID, input.toString());
                }
            });
            thread.start();