@Override public void onDrawOver(Canvas canvas, RecyclerView parent, RecyclerView.State state) {
    if (positionAdapter == null) {
      positionAdapter = new PositionAdapter(parent.getLayoutManager(), offset);
    }

    int childCount = parent.getChildCount();
    for (int i = 0; i < childCount; i++) {
      View child = parent.getChildAt(i);
      int absolutePosition = parent.getChildAdapterPosition(child);
      Position position = positionAdapter.getPositionByIndex(absolutePosition);
      Divider divider = dividerMap.getDivider(position, positionAdapter);
      drawDivider(canvas, child, divider, position);
    }
  }
Implementation of RecyclerView.ItemDecoration to display dividers between items.
To use it just create a new instance of this class properly initialized and set it as the
ItemDecoration of your RecyclerView.
dividers/src/main/java/com/karumi/dividers/DividerItemDecoration.java