I'm currently using DiffUtil/AsyncListDiffer with a List collection. I'm using the general adapter/recyclerview/ViewHolder implementation. Items are a List<Uri>
.
Can I use a LinkedHashSet instead of a List? Also, if yes, is it a major change?
Can I use a LinkedHashSet instead of a List? Also, if yes, is it a major change?
No LinkedHashSet
implements the Set
interface, not the List
interface.
Both Set
and List
have a common parent Collection
interface, however List
is the hardcoded interface type for DiffUtil
and AsyncListDiffer
. You would have to create custom implementations for data structures other than the List<T>
interface.