I already have a list adapter that works properly. But I want to divide the object in the list into sections according to the date they were created. Something like this:
I found something called "sectioned recycler view" but couldn't find any documentation on that. I read all the related questions, but they all are either outdated or use a third-party library. What's the native way of implementing this feature?
CodePudding user response:
You could create 2 types of view holders:
- header which holds the date
- data container which holds the other information.
And then create a list of objects which contain something like this: listToBind = (header, data, data, header, data, data)
CodePudding user response:
If you are using Jetpack Compose you can use the stickyHeader() as documented in the documentation