0

enter image description here

I need recycler view where each next item below previous one. It should overlap somehow. Is it possible using recyclerview?

Evgeniy Rechkov
  • 465
  • 4
  • 15

1 Answers1

0

All you need to add ItemdDecorator:

public class ItemDecorator extends RecyclerView.ItemDecoration {
    private final int mSpace;

    public ItemDecorator(int space) {
        this.mSpace = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        int position = parent.getChildAdapterPosition(view);
        outRect.right = -mSpace;
    }
}

And then while initializing recycler view:

binding.containerAction.rvGroupCallUserList.addItemDecoration(new ItemDecorator(80));
Evgeniy Rechkov
  • 465
  • 4
  • 15