Archived
Added more styles, changed some details.
This commit is contained in:
1 parent
de5d722ee4
commit
337f2defa8
5 files changed
+101
-23
No files matched your search
@@ -5,6 +5,8 @@ import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import android.net.Uri;
|
||||
|
||||
public class Event implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
public static final String ALL = "Alle";
|
||||
@@ -44,4 +46,20 @@ public class Event implements Serializable {
|
||||
public String toString() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public Uri getUri() {
|
||||
if (this.id <= 0)
|
||||
return null;
|
||||
|
||||
return Uri.parse("http://studentersamfundet.no/vis.php?ID=" + this.id);
|
||||
}
|
||||
|
||||
public Uri getImageUri() {
|
||||
if (this.id <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String imageUri = "http://studentersamfundet.no/imageResize.php?pic=bilder/program/{id}.jpg&maxwidth=480";
|
||||
return Uri.parse(imageUri.replaceAll("{id}", Integer.toString(this.id)));
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.studentersamfundet.app.ui;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.studentersamfundet.app.R;
|
||||
@@ -14,6 +15,14 @@ public class DnsActivity extends BaseDnsActivity {
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.main);
|
||||
|
||||
/* Set opening hours: */
|
||||
TextView openingHours = (TextView)findViewById(R.id.main_menu_openinghours);
|
||||
openingHours.setText(
|
||||
"Huset 13.00-01.00"
|
||||
+"\nKjøkkenet -19.00"
|
||||
+"\nBokCaféen 19.00-00.00");
|
||||
|
||||
}
|
||||
|
||||
public void programButton(View v) {
|
||||
|
||||
@@ -60,8 +60,7 @@ public class EventViewActivity extends BaseDnsActivity {
|
||||
link.setOnClickListener(new OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
String webAdress = "http://studentersamfundet.no/vis.php?ID=" + e.id;
|
||||
Uri webDestination = Uri.parse(webAdress);
|
||||
Uri webDestination = e.getUri();
|
||||
|
||||
Intent webIntent = new Intent(Intent.ACTION_VIEW, webDestination);
|
||||
startActivity(webIntent);
|
||||
|
||||
Reference in new issue
Block a user