0

I have a RecyclerView with list of items displayed top to bottom. I would like to have view of last item overlapping with the previous one.

I used RecyclerView.ItemDecoration with negative top margin and it almost does the trick. Item views indeed overlap, but when I'm at the bottom of the list and I start scrolling up then overlapping view disappears too early. It looks like RecyclerView does not take into account the negative margin at all when deciding if item is visible or not.

Is there a way to fix that? Thanks,

enter image description here

leszekt80
  • 15
  • 3
  • Please provide a visual example of what you strive to achieve or have achieved with negative top margin. It will make it easier for others to suggest implementations. Also, does this do the trick? https://stackoverflow.com/a/39216610/6835732 – Primož Ivančič Apr 01 '22 at 15:30
  • Thanks @PrimožIvančič I used the same approach as described in your link. Also I added video showing the issue. – leszekt80 Apr 01 '22 at 17:31
  • Do you want **all** of the items to overlap, or just the last one? In any case, using different layouts based on whether it needs to appear overlapped or not, might do the trick. – Primož Ivančič Apr 02 '22 at 08:28

0 Answers0