0

Say I have a RecyclerView and I'm populating it with an object.

And the object has a date field, and when a new date is reached, a standalone header is created with that date, and then the item is added. The following objects with the same date will not create a new header, unless it's a new date.

Is it possible to do this (maybe using getItemViewType), while also being compatible with ItemTouchHelper? So, if I remove the last item under a header at runtime, it'll also remove the header? Also can I make the header not swipeable?

Other SO-posts solutions, as far as I understand, expect that the header information will come as part of the list input, while I want it to be based on the date of the objects.

  • [Using with getItemViewType. Your answer is in this link link](https://stackoverflow.com/questions/26245139/how-to-create-recyclerview-with-multiple-view-types) – harun karaca Feb 14 '22 at 19:06
  • I've used that and made a header. But I wondered if it was possible to make a header that's seperate from the item, so when the user swipes (and deletes) the item, the header doesn't follow? – GlitzyWorm Feb 15 '22 at 08:41

0 Answers0