layout; private final Adapter adapter = new Adapter(); public MessagesView(Context context) { this(context, null); } public MessagesView(Context context, @Nullable AttributeSet attrs) { super(context, attrs); setHasFixedSize(false); layout = new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, true); setLayoutManager(layout); setAdapter(adapter); SimpleItemAnimator animator = new DefaultItemAnimator(); animator.setSupportsChangeAnimations(false); setItemAnimator(animator); } public void show(Message message) { adapter.add(message); if (layout.findFirstVisibleItemPosition() == 0) { layout.scrollToPosition(0); } } public void show(List<Message> messages) {adapter.add(messages);} public void addWidget(Widget widget) { adapter.add(widget); } private static class Adapter extends RecyclerView.Adapter<Widget.WidgetHolder> { ... } }