-
Notifications
You must be signed in to change notification settings - Fork 13
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
Object item IDs #50
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Item IDs have a problem, which is ensuring composed adapters with stable item IDs form a composite adapter whose ID ranges don't accidentally overlap. If they overlapped it'd result in strange behavior in
RecyclerView
, which would be difficult to debug. We also don't want users to have to worry about stable IDs outside of overridinggetItemId()
.Consider this related problem: what if your model IDs are strings? Many systems use UUIDs.
My thoughts right now are to change
PowerAdapter.getItemId()
to return anObject
instead. Since anObject
is unique in the system, any headers/footers would automatically have a stable ID. The challenge is how to map the objects into a range of longs in a way that isn't prone to memory leaks, and has decent performance.The text was updated successfully, but these errors were encountered: