Remove spacing between items in RecyclerView android
just remove the cardview in your layout/cardview_recycler.xml, android puts that spacing that you don't want
<LinearLayout
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<mypackagename.ui.view.RecyclingImageView
android:id="@+id/avatar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:adjustViewBounds="true"
android:src="@drawable/img_no_avatar" />
<TextView
android:id="@+id/username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:singleLine="true"
android:ellipsize="end"
android:padding="@dimen/spacing"
android:textColor="@color/black"
android:layout_alignParentBottom="true"
android:textSize="@dimen/text_smallest" />
</LinearLayout>
everything else stays as it is
Give android:layout_height = wrap_content instead of match_parent to your item root layout
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content">
-------
-------
</android.support.v7.widget.CardView>