Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ListView and Row Layout.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
>
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@color/colorAccent"
android:dividerHeight="1dp"
android:listSelector="#59d0ff"
>
</ListView>
</LinearLayout>
<?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="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:padding="10dp">
<ImageView
android:id="@+id/mainIcon"
android:src="@drawable/battery"
android:layout_width="100dp"
android:layout_height="100dp"
android:padding="5dp"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:layout_marginLeft="5dp"
android:layout_marginStart="5dp">
<TextView
android:id="@+id/mainTitle"
android:text="Title"
android:textStyle="bold"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#444"
/>
<TextView
android:id="@+id/mainDesc"
android:text="Description"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#444"
/>
</LinearLayout>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.