No, Really Listening To Your Friends
We also need to create a layout for our rows. We have three pieces of
information to display: the screen name of the friend, the status message,
and the date the status was modified. Create Patchy/res/layout/row.xml
with the following layout to display all three of those pieces:
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="4px"
>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:gravity="center_vertical"
>
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:textStyle="bold"
android:singleLine="true"
android:ellipsize="end"
/>
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:singleLine="true"
android:ellipsize="end"
/>
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="false"
/>
Now we need to replicate a lot of the logic from LunchList to populate this
custom list in Patchy.
Add a TimelineEntry inner class to Patchy to hold a single timeline entry:
189
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
We also need to create a layout for our rows. We have three pieces of
information to display: the screen name of the friend, the status message,
and the date the status was modified. Create Patchy/res/layout/row.xml
with the following layout to display all three of those pieces:
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="4px"
>
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_weight="1"
android:gravity="center_vertical"
>
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:textStyle="bold"
android:singleLine="true"
android:ellipsize="end"
/>
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:singleLine="true"
android:ellipsize="end"
/>
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:singleLine="false"
/>
Now we need to replicate a lot of the logic from LunchList to populate this
custom list in Patchy.
Add a TimelineEntry inner class to Patchy to hold a single timeline entry:
189
Subscribe to updates at http://commonsware.com
Special Creative Commons BY-NC-SA 3.0 License Edition
