How can I make for the recyclerview instead of filling from top to bottom starting from bottom to top.
EDITED
When I open my activity with recyclerview and it has several messages so that it exceeds the size of the screen as the new messages are off screen it only appears scrolling the screen I need it to be the opposite the new messages stay on the foot wheel and the older ones are at the top of the screen ..
@Override
protected void onStart () {
super.onStart();
FirebaseRecyclerAdapter<Chat, ChatViewHolder> firebaseRecycleAdapter = new FirebaseRecyclerAdapter<Chat, ChatViewHolder>(
Chat.class,
R.layout.chat_row,
ChatViewHolder.class,
mDatabase
) {
final String user_id = mAuth.getCurrentUser().getUid();
@Override
protected void populateViewHolder(ChatViewHolder viewHolder, Chat model, int position) {
final String post_key = getRef(position).getKey();
viewHolder.setName(model.getName());
viewHolder.setComentario(model.getComentario());
viewHolder.setFtperfil(getApplicationContext(), model.getFtperfil());
viewHolder.setData(model.getData());
viewHolder.mView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Toast.makeText(MainActivity.this, post_key , Toast.LENGTH_LONG).show();
Intent singleBlogIntent = new Intent(ActivityChat.this, ID_usuario_perfil.class);
singleBlogIntent.putExtra("blog_id", post_key);
startActivity(singleBlogIntent);
}
});
}};
}
});
mChatlist.setAdapter(firebaseRecycleAdapter);
}
public static class ChatViewHolder extends RecyclerView.ViewHolder {
View mView;
ImageButton mLikebtn;
DatabaseReference mDatabaseLike;
FirebaseAuth mAuth;
public ChatViewHolder(View itemView) {
super(itemView);
mView = itemView;
mLikebtn = (ImageButton) mView.findViewById(R.id.like_Btn);
mDatabaseLike = FirebaseDatabase.getInstance().getReference().child("Like");
mAuth = FirebaseAuth.getInstance();
mDatabaseLike.keepSynced(true);
}
public void setName (String username) {
RobotoTextView post_username = (RobotoTextView) mView.findViewById(R.id.nameChat);
post_username.setText(username);
}
public void setComentario (String comentario) {
TextView post_username = (TextView) mView.findViewById(R.id.messageChat);
post_username.setText(comentario);
}
public void setData (String comentario) {
TextView post_data = (TextView) mView.findViewById(R.id.dataChat);
post_data.setText(comentario);
}
public void setFtperfil(Context ctx, String ftperfil) {
CircleImageView post_perfil = (CircleImageView) mView.findViewById(R.id.imageChat);
Picasso.with(ctx).load(ftperfil).into(post_perfil);
}
}}