-
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
Let ItemAdapter supply item IDs #49
Comments
This is part of a wider 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 Consider this related problem: what if your model IDs are strings? Many systems use UUIDs. My thoughts right now are to change |
Added #50 to track this potential solution. |
Another idea: What if, as part of the
That adapter's Then, we could verify on every adapter composition that the sum of every adapter's count doesn't exceed
It's not perfect, but it would enable a lot of cases where IDs are known and bounded (like incrementing database IDs or |
This unfortunately wouldn't cover many common cases, such as string IDs, or even integer IDs generated on a remote database, since communicating the bounds typically wouldn't be possible. Thankfully, I think object IDs are possible using a |
For some applications, having stable item IDs is necessary. Currently if a PowerAdapter with stable IDs is composed with a
ViewFactory
orvarargs layoutResources
, it'll lose its stable item IDs asItemAdapter
doesn't support it. I think a way to supply item IDs when using theappend()
methods would be helpful. Maybe forlayoutResources
, have them default to the layout res (which is anint
)?The text was updated successfully, but these errors were encountered: