I'm following the Android Firebase Codelab.
Here's the project of the Friendly Chat app I'm attempting to modify: https://github.com/firebase/friendlychat-android/tree/master/android
I want the MessageViewHolder to be populated only after retrieving a message from the database. Unfortunately, right now, MessageViewHolder also gets populated locally (after the user presses 'SEND'). I don't want the latter to happen. That means the view holder gets updated twice (once locally and once after retrieval from the database) which is inefficient.
Side-node: Also, the user might think he's online when he presses 'SEND' and sees his MessageViewHolder get populated with his message. That's unwanted!
Please go to line 177 of MainActivity to see populateViewHolder method.
I've been trying to dodge the issue for the last couple of months, but now I really need the problem to be solved to continue working. What changes do I have to make to achieve what I want?