Break line when components inside Recyclerview occupy full screen width

Asked

Viewed 105 times

2

Is it possible to make that when the width of the components of a list occupies the total width of the screen, the next component drops a line? I don’t want to use scroll if it’s not possible to do this with Recyclerview which features I can use to solve this problem ?

Obs. Text1, Texto2, Texto3, etc... are layouts that have a Textview and the texts within these Textviews are of varying sizes.

Quebrar linha quando componentes chegarem ao final da tela

1 answer

0

I think you are using Linearlayoutmanager, just switch to Gridlayoutmanager.

  • I hadn’t tested Gridlayoutmanager, but I tested it here now and it has fixed columns, you insert this when creating the instance. What I’m looking for is almost that, but the first line can have, for example, 5 Textview and the second 2 and the third 3 and so on. After doing a brief search, I also saw here that has a method that allows specifying the amount of columns in each row, but requires me to know the size of Textview... Maybe I’ll do this manual implementation if no better option comes up. However this is not yet the complete answer, we are on the way.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.