Enhanced news list.

This commit is contained in:
Robert Kolner committed 2012-03-26 13:50:32 +02:00
1 parent c149ba038d
commit 7526b27d18
2 files changed
+16 -2

No files matched your search

+10 -2
View File
@@ -8,16 +8,24 @@
<TextView android:id="@+id/news_list_row_title"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:textSize="16sp" />
<TextView android:id="@+id/news_list_row_byline"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_below="@id/news_list_row_title"
android:textColor="#a0a0a0"
android:textSize="10sp" />
<TextView android:id="@+id/news_list_row_desc"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_alignParentLeft="true"
android:layout_below="@id/news_list_row_title"
android:layout_below="@id/news_list_row_byline"
android:textSize="12sp" />
</RelativeLayout>
@@ -1,5 +1,7 @@
package com.studentersamfundet.app.ui.lists;
import java.text.SimpleDateFormat;
import com.studentersamfundet.app.News;
import com.studentersamfundet.app.R;
@@ -47,10 +49,14 @@ public class NewsListActivity extends BaseListActivity {
TextView title = (TextView)row.findViewById(R.id.news_list_row_title);
TextView description = (TextView)row.findViewById(R.id.news_list_row_desc);
TextView footer = (TextView)row.findViewById(R.id.news_list_row_byline);
title.setText(article.title);
description.setText(article.description);
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm, d. MMMM y");
footer.setText(sdf.format(article.pubDate));
return row;
}
};