h6ah4i / android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
https://advancedrecyclerview.h6ah4i.com/
Apache License 2.0
5.32k stars 860 forks source link

Item insertion in ComposedAdapter #426

Open kaltert opened 6 years ago

kaltert commented 6 years ago

I want to use two adapters and a RecyclerView to achieve the following:

List header(first list)

List item 0 List item 1 Add new list item

List header(Second list)

List item 0 List item 2 List item 3 Add new list item

I have decided to go with the ComposedAdapter that includes my 2 adapters. My datasets for the adapters are at the Activity witch is where I also add new objects to the datasets(Lists).

Now, I am not sure how to handle item insertions. On what instance should I call notifyItemInserted() and with what position?