Skip to content

Instantly share code, notes, and snippets.

@rahulkhatri19
Created April 24, 2019 11:21
Show Gist options
  • Save rahulkhatri19/2540281c657e5aec83a5ff793634f8c2 to your computer and use it in GitHub Desktop.
Save rahulkhatri19/2540281c657e5aec83a5ff793634f8c2 to your computer and use it in GitHub Desktop.
Layout for Sample Data in RecyclerView
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="4dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="64dp"
android:layout_height="64dp"
tools:src="@tools:sample/avatars" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:orientation="vertical"
android:layout_marginLeft="16dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="@tools:sample/full_names" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="@tools:sample/us_phones" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment