Android favorites contacts layout

95 Views Asked by At

I'm trying to make a layout similar to the favorite contacts of Android, but I do not know how to do it or what plan to use (FrameLayout, LinearLayout, ...)

Can anybody help me?

Thank you.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/cv"
android:layout_width="175dp"
android:layout_height="140dp"
android:layout_margin="1dp"
android:background="@drawable/contacts_back_free"
android:orientation="vertical"
android:padding="1dp"
android:paddingTop="10dp">

<ImageView
    android:id="@+id/person_photo"
    android:layout_width="70dp"
    android:layout_height="70dp"
    android:layout_gravity="center_horizontal"
    android:layout_margin="1dp"
    android:adjustViewBounds="true"
    android:background="@android:drawable/ic_menu_gallery"
    android:padding="6dp"
    android:paddingTop="10dp" />

<TextView
    android:id="@+id/person_name"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_toRightOf="@+id/person_photo"
    android:textAlignment="center"
    android:textSize="14sp"
    tools:text="Nombre telefono" />

<TextView
    android:id="@+id/person_age"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/person_name"
    android:layout_toRightOf="@+id/person_photo"
    android:textAlignment="center"
    android:textSize="10sp"
    tools:text="id estado" />

Contacts layout image I need make this item layout

Item layout that I need

1

There are 1 best solutions below

2
On

you could use recyclerview and set its layout manager with gridlayoutmanager. and in adapter of recyclerview you can define the layout of particular grid item.