Merge branch 'master' of github.com:neuf/DNSapp
No files matched your search
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 13 KiB |
@@ -17,11 +17,10 @@
|
||||
<!-- Formålsparagraf -->
|
||||
<ImageView
|
||||
android:id="@+id/paragraph"
|
||||
android:layout_marginTop="100px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_below="@id/header"
|
||||
android:layout_above="@id/footer"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/partest" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -22,7 +22,19 @@ public class DataHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Event[] populateList() {
|
||||
return events.toArray(new Event[events.size()]);
|
||||
public Event[] populateList(String category) {
|
||||
LinkedList<Event> sorted = new LinkedList<Event>();
|
||||
|
||||
if (category == "all") {
|
||||
return events.toArray(new Event[events.size()]);
|
||||
} else {
|
||||
for (int i = 0; i < events.size(); i++) {
|
||||
Event tmp = events.get(i);
|
||||
|
||||
if (category.equals(tmp.category))
|
||||
sorted.add(tmp);
|
||||
}
|
||||
return sorted.toArray(new Event[sorted.size()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class ProgramListActivity extends BaseDnsActivity {
|
||||
}
|
||||
|
||||
protected ListAdapter createAdapter() {
|
||||
Event[] events = dataHandler.populateList();
|
||||
Event[] events = dataHandler.populateList("all");
|
||||
|
||||
ListAdapter adapter = new ArrayAdapter<Event>(this, R.layout.event_list_row, R.id.event_list_row_text, events) {
|
||||
@Override
|
||||
|
||||