Horizontal RecylerView as WhatsApp

1

I would like your help on how to do this layout of the "Media" part of a given WhatsApp Contact. It would be this CardView integer called "Media".

It would be almost exactly the same way, I have no doubt about the adapters, only doubt about the layout xml. The images would also all be of the same size in this square.

    
asked by anonymous 13.11.2015 / 18:43

1 answer

2

When you create a RecyclerView you have to assign it a LayoutManager . In this case (horizontal list) assign a LinearLayoutManager specifying LinearLayoutManager.HORIZONTAL no builder :

LinearLayoutManager manager = new LinearLayoutManager(this, 
                                                      LinearLayoutManager.HORIZONTAL, false);

RecyclerView midiaList = (RecyclerView) findViewById(R.id.a_sua_recycler_view);
midiaList.setLayoutManager(manager);
    
13.11.2015 / 18:54