title: RecyclerView ItemDecoration
body: <p>I am trying to create an ItemDecoration drawn as a divider between a RecyclerView items with left padding.</p>
  
  <p>Currently I have this implementation inside ItemDecoration class:</p>
  
  <pre><code>@Override
  public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
      final int left = parent.getPaddingLeft();
      final int right = parent.getWidth() - parent.getPaddingRight();
      final RecyclerView.LayoutManager lm = parent.getLayoutManager();
      final int childCount = parent.getChildCount();
  
      for (int i = 0; i &lt; childCount; i++) {
          final View child = parent.getChildAt(i);
          RecyclerView.ViewHolder viewHolder = parent.getChildViewHolder(child);
  
          final int top = lm.getDecoratedBottom(child);
          final int bottom = top + mDivider.getIntrinsicHeight();
          mDivider.setBounds(left + 40, top, right, bottom);
          mDivider.draw(c);
      }
  }
  </code></pre>
  
  <p>But it seems like the divider is still drawing itself full width. So what am I doing wrong?</p>
  
  <p>I also tried setting an InsetDrawable with left insets (from xml), as the divider, but it seems like it will not draw it at all.</p>
  
  <p>PS. That 40 value is just a hardcoded one, for explanatory purpose. mDivider is a Drawable.</p>