I have GridView:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/frag_books_grid_view_layout"
android:orientation="vertical">
<GridView
android:cacheColorHint="@color/bg_default"
android:listSelector="@drawable/list_selector_background"
android:id="@+id/frag_books_grid_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:columnWidth="120px"
android:gravity="center"
android:horizontalSpacing="15dp"
android:scrollbars="none"
android:stretchMode="columnWidth"
/>
</LinearLayout>
And single item (placed in cell of this grid):
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:cacheColorHint="@color/bg_default"
android:scrollbars="none"
android:listSelector="@drawable/list_selector_background"
android:layout_gravity="center_vertical|left"
android:gravity="center_vertical|left"
android:padding="15dp"
android:id="@+id/frag_book_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:verticalSpacing="5dp"/>
How it looks: https://i.stack.imgur.com/2q51E.png Everything is fine with blue selection, but the contents of the cell is not centered inside of it. This picture explains what I want: https://i.stack.imgur.com/6o8zh.png