title: Custom ItemDecoration class is not drawing divider on last item
body: <p>I have a custom ItemDecoration class that is not drawing the last divider for my last item. </p>
  
  <p>Custom Decoration class:</p>
  
  <pre><code>public class DividerTest extends RecyclerView.ItemDecoration {
      private Drawable mDivider;
  
      public DividerTest(Context context) {
          mDivider = context.getResources().getDrawable(R.drawable.divider_horizontal);
      }
  
      @Override
      public void onDraw(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) {
          int left = parent.getPaddingLeft();
          int right = parent.getWidth() - parent.getPaddingRight();
  
          int childCount = parent.getChildCount();
          for (int i = 0; i &lt; childCount; i++) {
              View child = parent.getChildAt(i);
  
              RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
              int top = child.getBottom() + params.bottomMargin;
              int bottom = top + mDivider.getIntrinsicHeight();
              mDivider.setBounds(left, top, right, bottom);
              mDivider.draw(c);
  
          }
      }
  
  }
  </code></pre>
  
  <p>Usage: </p>
  
  <pre><code>RecyclerAdapter adapter = new RecyclerAdapter(list, this);
  mRecycler.setLayoutManager(new LinearLayoutManager(this));
  DividerTest divider = new DividerTest(this);
  mRecycler.addItemDecoration(divider);
  mRecycler.setAdapter(adapter);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/7yZjR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7yZjR.png" alt="divi"></a></p>
  
  <p>When I use the default DividerItemDecoration class, it works:</p>
  
  <pre><code>RecyclerAdapter adapter = new RecyclerAdapter(list, this);
          mRecycler.setLayoutManager(new LinearLayoutManager(this));
          DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(this, DividerItemDecoration.VERTICAL);
          mRecycler.addItemDecoration(dividerItemDecoration);
          mRecycler.setAdapter(adapter);
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/83BL6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/83BL6.png" alt="enter image description here"></a></p>
  
  <p>Why is my custom item decoration class not drawing my last divider?</p>