mikepenz / FastAdapter

The bullet proof, fast and easy to use adapter library, which minimizes developing time to a fraction...
https://mikepenz.dev
Apache License 2.0
3.83k stars 492 forks source link

How made dynamic model list? #1029

Closed NetylkinOV closed 2 years ago

NetylkinOV commented 2 years ago

About this issue

Hello, Mike. Can you please tell me how to implement something like this using FastAdapter? Please note that the length of the text of the elements is different and can occupy the entire width of the screen. I tried to do it through GridLayout with 3 columns, but it doesn't work, I have to cut off the text if it goes beyond the column width.

Maybe there are some options?

~h ttps://fastpic.org/session/2022/0228/S9w7xoqo28.html~

mikepenz commented 2 years ago

Please attach a screenshot to the ticket (can't follow the link due to security concerns)

You mean you have an item which may have a different height if the text expands further?

Or you have flexible width items in the list?

Neither are an adapter matter.

You'd probably have to compute the columns you need per item, and then accordingly tell the RV similar like in the grid layout how many columns each item type needs.

NetylkinOV commented 2 years ago

xzxz Screenshot

mikepenz commented 2 years ago

This looks to be best done via: https://material.io/components/chips/android#using-chips

I don't think this is a ticket related for this library.

NetylkinOV commented 2 years ago

Mike, the height is the same for all elements, but the width can be different. May take up the entire screen. Let's look at the first row of elements in the screenshot. The first element is wider than the other two (which are the same in width) The whole point of this task is that we set the width of the columns for the gridlayout to be static, so for the first row and the first element the column width will be 130, then for the first element of the second row (which is lower) it is needed in 100. Because it is necessary that the elements are located next to each other without a large number of spaces between them.

So I decided to write to you to discuss it :)

It turns out that I need to look for some other solution for such a problem for me :)

NetylkinOV commented 2 years ago

Yes, indeed, it is a good idea to do it through chips. I've never experienced this before, I'll try. Thanks for the idea :)

NetylkinOV commented 2 years ago

Thank you for help 👍