I have created a custom xml file that contains some elements that make up the rows in a ListView. I’ve set the preview of the ListView to be this xml file. I can’t figure out how to get rid of the default “Item 1”, “Item 2”, “Item 3” … however.
Does anyone have an idea on what could be causing this?
Here’s the code as well as a screenshot:
my_custom_list.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="8dp"
android:paddingRight="8dp">
<ListView android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawSelectorOnTop="false">
<!-- Preview: listitem=@layout/my_custom_list_row -->
</ListView>
</LinearLayout>
my_custom_list_row.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="6dip"
android:orientation="horizontal">
<CheckBox
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_marginRight="6dip"
/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="6dip"
android:orientation="vertical" >
<TextView
android:id="@+id/secondLine"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:text="Senders Name"
android:textStyle="bold" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="Subject"
android:textStyle="italic" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:lines="3"
android:gravity="center_vertical"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla viverra mattis nulla nec sollicitudin." />
</LinearLayout>
</LinearLayout>

No, it does not seem possible or this is a bug in the ADT plugin that I keep running into. I get by by just previewing the row to make sure it looks ok. If you need to render UI images you can use something like Pencil and import Android Stencils to it.