title: GridLayoutManager with custom divider
body: <p>I am trying to add custom divider in <code>RecyclerView</code> with <code>GridLayoutManager</code> but not getting success, i have searched a lot and looked into below mention answer but it didn't help me</p>
  
  <p><a href="https://stackoverflow.com/questions/29146781/decorating-recyclerview-with-gridlayoutmanager-to-display-divider-between-item">link 1</a><br>
  <a href="https://stackoverflow.com/questions/32654844/how-to-add-a-divider-between-each-grid-of-recyclerview">link 2</a><br>
  <a href="https://stackoverflow.com/questions/28531996/android-recyclerview-gridlayoutmanager-column-spacing">link 3</a></p>
  
  <p>I want to put black line in between each items of <code>RecyclerView</code>, something like below.</p>
  
  <p><a href="https://i.stack.imgur.com/RGdKT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/RGdKT.png" alt="enter image description here"></a></p>
  
  <p>I have got horizontal line in between each row, but not able to find how to get those lines in between columns also.</p>
  
  <p><a href="https://stackoverflow.com/a/39491548/3134215">chintan soni's</a> answer worked perfectly, but it is creating problem in one scenario only, when i am having 5 views, it shows divider of other 3 items also, like below :</p>
  
  <p><a href="https://i.stack.imgur.com/kc0MC.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kc0MC.png" alt="enter image description here"></a></p>