android-mvvm icon indicating copy to clipboard operation
android-mvvm copied to clipboard

Reactive list for recyclerview/viewpager

Open mike-mathieu opened this issue 8 years ago • 2 comments
trafficstars

How about using a reactive list for populating the RecyclerViews and ViewPagers? Such as if you wanted to add or remove items from a list without redisplaying the entire list. Something like this.

Again, awesome library.

mike-mathieu avatar Mar 15 '17 23:03 mike-mathieu

This is a great idea. It would also enable building an adapter that creates animates the changes in RecyclerView. I think ReactiveList implementation should be a separate library. If there are already existing implementations, support can be integrated as an optional module. With #40, one of the options that I am considering is using databinding.ObservableList as the base for setting up adapters. ObservableList implements the necessary callbacks mentioned by you. As its part of databinding, it won't impose any additional dependency on library consumers. However, there are concerns (mentioned on that issue) which need to be addressed before this approach is implemented.

manas-chaudhari avatar Mar 16 '17 12:03 manas-chaudhari

Hmm yes if I understand correctly I think ObservableList will do just what's needed, perfect.

mike-mathieu avatar Mar 16 '17 17:03 mike-mathieu