I want to create a layout for the elements of grid
in a regilla way, its base is an icon, title and total
Now what I have is more or less like the following image
The layout:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="120dp"
android:layout_height="120dp"
android:orientation="horizontal"
android:padding="5dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:srcCompat="@drawable/ic_menu_manage" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorAccent"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:orientation="vertical"
android:layout_alignParentBottom="true">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
tools:text="Favorites" />
<TextView
android:id="@+id/size"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
tools:text="12" />
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
What does not come out
The icon is now centered on the whole of the box, so I need the icon to focus only on what the white space occupies.