use of ingage.ingage.helpers.ChatMessageHelper in project iNGAGE by davis123123.
the class ChatFragment method appendChatConversation.
private void appendChatConversation(DataSnapshot dataSnapshot) {
Iterator i = dataSnapshot.getChildren().iterator();
Log.d("STATE", "pageData2 : " + dataSnapshot);
while (i.hasNext()) {
chat_id = dataSnapshot.getKey();
Log.d("STATE", "result : " + chat_id);
chat_msg = (String) ((DataSnapshot) i.next()).getValue();
chat_side = (String) ((DataSnapshot) i.next()).getValue();
chat_timestamp = (String) ((DataSnapshot) i.next()).getValue();
chat_username = (String) ((DataSnapshot) i.next()).getValue();
chat_downvote = (Long) ((DataSnapshot) i.next()).getValue();
chat_upvote = (Long) ((DataSnapshot) i.next()).getValue();
String chat_userVote;
chat_userVote = userVotes.get(chat_id);
Log.d("CHATVOTE", "result : " + chat_userVote);
ChatMessageHelper msg = new ChatMessageHelper(chat_id, chat_side, chat_msg, chat_username, chat_upvote, chat_downvote, chat_timestamp, chat_userVote);
chatAdapter.add(msg);
}
chatAdapter.notifyDataSetChanged();
recyclerView.scrollToPosition(chatAdapter.getItemCount() - 1);
}
Aggregations