-
Notifications
You must be signed in to change notification settings - Fork 134
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
FR: Support sections in RealmRecycler #129
Comments
The poorman's version of this is to create an unmanaged RealmList and add your sections as dummy items. Then set the item type accordingly when you implement the adapter. Though I haven't actually tested this but the concept should be workable. Having said that, it is a rather hacky solution and the likely new problem that is then introduced is how to efficiently build this dummy list (and keep it up to date if you want to re-organize your sections). Edit: if realm did support GROUP BY type operation doing this might become easier assuming such operation would have an API allowing access to the grouped items from its result. realm/realm-java#2309 (comment) (note: this does not exist, but it sure would be nice convenience to have) |
One other way is to use |
I had 4 sections, and the way I ended up implementing it was to have 4 different I added in strings for the headers and in my Adapter, I overrode This got too costly though. There was a visible delay when loading the One good thing though, was that you could still have animations work when you used The other alternative (especially if you have a logical way) is to have just one |
Support sections in Recycler View with RealmRecyclerViewAdapter.
I would like can add more than one header in a RealmRecyclerViewAdapter.
I have one list of items that I wanna separate by 2 sections.
The first will be the items added in a header with name "DAY" and the other items in a section header with name "ITEMS".
The text was updated successfully, but these errors were encountered: