Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break down a list by section #23

Open
Talgat777 opened this issue Sep 22, 2020 · 3 comments
Open

Break down a list by section #23

Talgat777 opened this issue Sep 22, 2020 · 3 comments

Comments

@Talgat777
Copy link

Hi, guys!

I have a 🚀Feature request.

Is it possible to group items by sections? Ideally make them expandable/collapsable. I understand that in this case pagination wouldn't be supported. Looking for something like this:
Expand/collapse sections image

Would be great to also support different type of cells/rows based on unit name/type. For example:
A mix of different type of cells image

Let me know if I should create a separate feature request for both. I wasn't sure if it's even on your scope of dev pipeline.

Thanks!

@Alex009
Copy link
Member

Alex009 commented Sep 25, 2020

@Talgat777 hi!
for now you can mix many different item types in one list, so you can create items for example:
SectionHeaderUnitItem
SectionItemUnitItem

and in units set:

listOf(SectionHeaderUnitItem("section 1"), SectionItemUnitItem(...), SectionItemUnitItem(...), SectionItemUnitItem(...))

and for collapsing you also can use this items. for example add onPress lambda to SectionHeaderUnitItem and when it pressed - add bunch of SectionItemUnitItem, on press again - remove this SectionItemUnitItem.

about "Would be great to also support different type of cells/rows based on unit name/type" - we already support different types :) just mix any item types as you wish.

https://github.com/icerockdev/moko-paging/blob/master/sample/mpp-library/src/commonMain/kotlin/com/icerockdev/library/ListViewModel.kt#L43 here example - list contains progress bar item in the end, if page loading in progress

@Talgat777
Copy link
Author

@Alex009 Nice! I'll have another look! Thanks!

Is there also a way to have multiple columns and control cell height?

Multiple columns

@Alex009
Copy link
Member

Alex009 commented Oct 6, 2020

@Talgat777 hi! sorry for late reply.
to use multiple columns you should use CollectionUnitItem with RecyclerView on android and UICollectionView on iOS.
Height controlled on ui side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants