You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm relatively new to RxJava and also not an Android expert, so take this proposal with a grain of salt.
I have a use-case where not all items of the RecyclerView are known in advance (Bluetooth devices that are discovered dynamically).
AFAIS, this use case is not currently covered by RxRecyclerAdapter because all classes basically take a List<T> in advance and allow a certain set of operations on this list.
Now I was wondering why the classes in the library don't just accept a Observable<List<T>>. Then you wouldn't have to reimplement all those methods in RxDataSource because you could just pass an Observable which has all those operations applied already.
I've drafted a minimal working example here.
Do you see any problems with that approach?
Would this be worthy a direction to pursue in RxRecyclerAdapter, or should I rather create this as a separate project?
The text was updated successfully, but these errors were encountered:
Hi @nightscape sorry for a very late response... I have been away from android development for some time...
Regarding your approach and suggestion, I think that's a good direction to go into... Specially the part about the library accepting Observable<List<T>>... I'll definitely see if I can integrate that in the next update...
As for the dynamic part, I think you can add items dynamically by doing this :
If it's a complete new dataSet rxDataSource.updateDataSet(dataSet).updateAdapter();
If you want to add further items to dataSet rxDataSource.getRxAdapter().getDataSet().addAll(dataSet).updateAdapter();
Hi @ahmedrizwan,
I'm relatively new to RxJava and also not an Android expert, so take this proposal with a grain of salt.
I have a use-case where not all items of the RecyclerView are known in advance (Bluetooth devices that are discovered dynamically).
AFAIS, this use case is not currently covered by RxRecyclerAdapter because all classes basically take a
List<T>
in advance and allow a certain set of operations on this list.Now I was wondering why the classes in the library don't just accept a
Observable<List<T>>
. Then you wouldn't have to reimplement all those methods inRxDataSource
because you could just pass anObservable
which has all those operations applied already.I've drafted a minimal working example here.
Do you see any problems with that approach?
Would this be worthy a direction to pursue in RxRecyclerAdapter, or should I rather create this as a separate project?
The text was updated successfully, but these errors were encountered: