use of br.ufrj.caronae.comparators.ChatMsgComparator in project caronae-android by caronae.
the class ChatAct method configureActivityWithChatAssets.
private void configureActivityWithChatAssets(ChatAssets chatAssets) {
context = this;
color = chatAssets.getColor();
int colorPressed = Util.getPressedColorbyNormalColor(color);
lay1.setBackgroundColor(color);
toolbar.setBackgroundColor(color);
int bgRes = chatAssets.getBgRes();
// send_bt.setBackgroundResource(bgRes);
send_bt.setColorNormal(color);
send_bt.setColorPressed(colorPressed);
String neighborhood = chatAssets.getLocation();
// neighborhood_tv.setText(neighborhood);
String date = chatAssets.getDate();
// date_tv.setText(date);
String time = chatAssets.getTime();
// time_tv.setText(time);
headerText.setText(neighborhood + " - " + date + " - " + time);
chatMsgsList = ChatMessageReceived.find(ChatMessageReceived.class, "ride_id = ?", rideId);
Collections.sort(chatMsgsList, new ChatMsgComparator());
chatMsgsAdapter = new ChatMsgsAdapter(chatMsgsList, color);
chatMsgs_rv.setAdapter(chatMsgsAdapter);
chatMsgs_rv.setLayoutManager(new LinearLayoutManager(context));
chatMsgsAdapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {
@Override
public void onChanged() {
super.onChanged();
Util.toast("mudou");
}
});
if (!chatMsgsList.isEmpty())
chatMsgs_rv.scrollToPosition(chatMsgsList.size() - 1);
}
Aggregations