Archived
Added styles, fixed a few typos, added some additional information to event view (location, date, link to website).
This commit is contained in:
1 parent
1b20abdb94
commit
0f97ede07d
6 files changed
+87
-5
No files matched your search
@@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/ListItem"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@@ -18,13 +18,43 @@
|
||||
|
||||
<!-- The event -->
|
||||
<TextView android:id="@+id/event_view_title"
|
||||
style="@style/BigHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/header" />
|
||||
|
||||
<TextView android:id="@+id/event_view_decription"
|
||||
<!-- Kind of "header" under title, but above description.
|
||||
It is supposed to contain event date, location, ... -->
|
||||
<RelativeLayout android:id="@+id/event_view_header"
|
||||
style="@style/SmallHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/event_view_title">
|
||||
|
||||
<TextView android:id="@+id/event_view_location"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentLeft="true" />
|
||||
|
||||
<TextView android:id="@+id/event_view_datetime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentRight="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView android:id="@+id/event_view_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/event_view_title" />
|
||||
android:layout_below="@id/event_view_header" />
|
||||
|
||||
<Button android:id="@+id/event_view_link"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@id/footer"
|
||||
android:layout_margin="10px"
|
||||
android:text="@string/event_link_button"
|
||||
android:visibility="invisible" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -3,6 +3,7 @@
|
||||
<string name="app_name">Det Norske Studentersamfund</string>
|
||||
<string name="program_button">PROGRAM</string>
|
||||
<string name="bli_med_button">BLI MED</string>
|
||||
<string name="event_link_button">Gå til nettsiden</string>
|
||||
<string name="error_noconnection_firstart">Ingen nettilkobling. Du må være tilkoblet nettet for å se programmet.</string>
|
||||
<string name="error_noconnection_noupdate">Ingen nettilkobling. Programmet er altså ikke oppdatert.</string>
|
||||
<string name="join_us">Booke band, tappe øl eller lede politiske debatter? Du vil garantert finne noe av interesse hvis du har lyst til å bli aktiv i en av de mange foreningene som driver DNS. Her lærer vi alt du ikke hører om på forelesningene. Praktisk erfaring og utfordringer som kan være gull verdt når den voksne verden en gang banker på døren.\n\nHva vil du huske fra studietiden? Lesesalen? Pensum? Eksamensnerver? Det er nå du har sjansen til å skape minnene som varer hele livet. Venner, fester, gallamiddager og nach så lenge du orker.\n\n “Vi gir deg minnene fra studietiden du aldri vil glemme.”\n\nTa kontakt på blimed@studentersamfundet.no for mer informasjon!</string>
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="BigHeader">
|
||||
<item name="android:textSize">20sp</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
|
||||
<style name="SmallHeader">
|
||||
<item name="android:textSize">12sp</item>
|
||||
<item name="android:textColor">#aaaaaa</item>
|
||||
<item name="android:background">#303030</item>
|
||||
<item name="android:paddingBottom">5px</item>
|
||||
</style>
|
||||
|
||||
<style name="ListItem">
|
||||
<item name="android:textSize">12sp</item>
|
||||
</style>
|
||||
|
||||
<color name="ListItemEven">#202020</color>
|
||||
<color name="ListItemOdd">#000000</color>
|
||||
</resources>
|
||||
@@ -1,7 +1,11 @@
|
||||
package com.studentersamfundet.app.ui;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.view.View.OnClickListener;
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.studentersamfundet.app.Event;
|
||||
@@ -14,16 +18,35 @@ public class EventViewActivity extends BaseDnsActivity {
|
||||
setContentView(R.layout.event_view);
|
||||
|
||||
Intent intent = getIntent();
|
||||
Event e = (Event)intent.getSerializableExtra("event");
|
||||
final Event e = (Event)intent.getSerializableExtra("event");
|
||||
|
||||
if (e == null) {
|
||||
throw new Error("This should NEVER happen");
|
||||
}
|
||||
|
||||
TextView title = (TextView) findViewById(R.id.event_view_title);
|
||||
TextView desc = (TextView) findViewById(R.id.event_view_decription);
|
||||
TextView description = (TextView) findViewById(R.id.event_view_description);
|
||||
TextView location = (TextView) findViewById(R.id.event_view_location);
|
||||
TextView datetime = (TextView) findViewById(R.id.event_view_datetime);
|
||||
Button link = (Button) findViewById(R.id.event_view_link);
|
||||
|
||||
title.setText(e.title);
|
||||
desc.setText(e.description);
|
||||
description.setText(e.description);
|
||||
location.setText(e.location);
|
||||
datetime.setText(e.date);
|
||||
|
||||
if (e.id > 0) { // if id exists and seems legit
|
||||
link.setVisibility(View.VISIBLE);
|
||||
link.setOnClickListener(new OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
String webAdress = "http://studentersamfundet.no/vis.php?ID=" + e.id;
|
||||
Uri webDestination = Uri.parse(webAdress);
|
||||
|
||||
Intent webIntent = new Intent(Intent.ACTION_VIEW, webDestination);
|
||||
startActivity(webIntent);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,6 +68,12 @@ public class ProgramListActivity extends BaseDnsActivity {
|
||||
row = convertView;
|
||||
}
|
||||
|
||||
/* Apply styles: */
|
||||
if (position % 2 == 0)
|
||||
row.setBackgroundResource(R.color.ListItemEven);
|
||||
else
|
||||
row.setBackgroundResource(R.color.ListItemOdd);
|
||||
|
||||
final Event e = getItem(position);
|
||||
|
||||
TextView titleView = (TextView) row.findViewById(R.id.event_list_row_text);
|
||||
|
||||
Reference in new issue
Block a user