Remove left and right padding in recyclerview list
<p>I have been loading images in <code>recyclerview</code> list. In that left and right side of the image having some padding.</p>

<p>I need to remove those padding.But I'm not sure how the paddings were added at left and right side of the <code>recyclerview</code> items.</p>

<p>Below I have posted the screen shot and code relevant to this:</p>

<p><a href="https://i.stack.imgur.com/N71A0.png" rel="nofollow"><img src="https://i.stack.imgur.com/N71A0.png" alt="enter image description here"></a></p>

<p>As in the above screenshot, you can see the small left and right padding.I need to remove that.</p>

<p><strong>Edited:</strong></p>

<p><strong>Activity Code:</strong></p>

<pre><code>recyclerView = (RecyclerView) findViewById(R.id.rv_list_tab_home_recycler);

mLayoutManager = new LinearLayoutManager(this);

recyclerView.setLayoutManager(mLayoutManager);
//  recyclerView.setItemAnimator(new DefaultItemAnimator());
recyclerView.setAdapter(homePostitemsAdapter);
recyclerView.setNestedScrollingEnabled(false);
</code></pre>

<p><strong>activity_layout.xml:</strong> </p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;

&lt;android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="fill_vertical"
    android:fillViewport="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"&gt;

    &lt;LinearLayout
        android:id="@+id/tab_home_activity"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"&gt;

        &lt;android.support.v7.widget.RecyclerView
            android:id="@+id/rv_list_tab_home_recycler"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:clipToPadding="false"
            android:scrollbars="vertical"
            android:visibility="visible" /&gt;

    &lt;/LinearLayout&gt;

&lt;/android.support.v4.widget.NestedScrollView&gt;
</code></pre>

<p><strong>adapter_layout:</strong></p>

<pre><code>&lt;RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="5dp" &gt;

    &lt;LinearLayout
        android:id="@+id/rl_vertical_list"
        android:visibility="visible"
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"&gt;

        &lt;RelativeLayout
            android:id="@+id/post_items_layout_middle_home"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp" &gt;

            &lt;LinearLayout
                 android:id="@+id/ll_posted_image_parent"
                 android:layout_width="match_parent"
                 android:orientation="vertical"
                 android:layout_below="@+id/tv_user_posted_msg_post_items_home"
                 android:layout_height="wrap_content"&gt;

             &lt;/LinearLayout&gt;
         &lt;/RelativeLayout&gt;
     &lt;/LinearLayout&gt;
 &lt;/RelativeLayout&gt;
</code></pre>

<p><strong>Adapter Code:</strong></p>

<p>I'm adding imageview programatically to the linearlayout.</p>

<pre><code>DisplayMetrics dm = new DisplayMetrics();


((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(d‌​m); 

int deviceWidth = dm.widthPixels; 

int deviceHeight = deviceWidth * imageHeight / imageWidth;

holder.ivPostedImageNew = new ImageView(context);
params = new LinearLayout.LayoutParams(deviceWidth, deviceHeight);

holder.ivPostedImageNew.setLayoutParams(params);
holder.ivPostedImageNew.setPadding(0, 0, 0, 0);
holder.ll_posted_image_parent.addView(holder.ivPostedImageNew);
</code></pre>

<p>I'm not sure where it takes padding left and right.<code>All views inside the adapter having left and right padding space</code>.Anyone can help me with this.Thank You.</p>