title: how to set equal margin between recyclerview items
body: <p><a href="https://i.stack.imgur.com/6S6xb.png" rel="noreferrer"><img src="https://i.stack.imgur.com/6S6xb.png" alt="This image"></a></p>
  
  <p><a href="https://imgur.com/a/SM2gi" rel="noreferrer">See this Image</a></p>
  
  <p>I achieved the current margin from xml layout but its not same through all four sides.</p>
  
  <p>How to get equal margin </p>
  
  <p>My current xml layout</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="300dp"&gt;
  
  &lt;ImageView
      android:id="@+id/iv_photo"
      android:layout_width="match_parent"
      android:layout_height="300dp"
      android:layout_marginEnd="6dp"
      android:layout_marginTop="6dp"
      android:adjustViewBounds="true"
      android:background="@color/colorPrimary"
      android:foreground="?android:attr/selectableItemBackground"
      android:scaleType="fitXY" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>