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
+63
-20
@@ -32,50 +32,93 @@
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<Button android:id="@+id/main_menu_program"
|
||||
<RelativeLayout android:id="@+id/main_menu_program"
|
||||
style="@style/MetroTile"
|
||||
android:layout_margin="5px"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:onClick="programButton"
|
||||
android:text="Button 1" />
|
||||
android:onClick="programButton">
|
||||
|
||||
<TextView
|
||||
style="@style/MetroTileText_bg"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="@string/program_button" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<Button android:id="@+id/main_menu_tickets"
|
||||
<RelativeLayout
|
||||
style="@style/MetroTile"
|
||||
android:layout_margin="5px"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:onClick="ticketButton"
|
||||
android:text="Button 2" />
|
||||
android:layout_weight="1">
|
||||
|
||||
<TextView android:id="@+id/main_menu_openinghours_header"
|
||||
style="@style/MetroTileText"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
android:text="Text 1" />
|
||||
|
||||
<!-- This is set in Java: -->
|
||||
<TextView android:id="@+id/main_menu_openinghours"
|
||||
style="@style/MetroTileText"
|
||||
android:textSize="10sp"
|
||||
android:typeface="monospace"
|
||||
android:gravity="left"
|
||||
|
||||
android:layout_marginTop="20px"
|
||||
android:layout_marginBottom="20px"
|
||||
android:layout_marginLeft="5px"
|
||||
android:layout_marginRight="5px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_below="@id/main_menu_openinghours_header" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<Button android:id="@+id/main_menu_stream"
|
||||
<RelativeLayout android:id="@+id/main_menu_tickets"
|
||||
style="@style/MetroTile"
|
||||
android:layout_margin="5px"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:onClick="streamButton"
|
||||
android:text="Button 3" />
|
||||
android:onClick="ticketButton">
|
||||
|
||||
<TextView
|
||||
style="@style/MetroTileText"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="Billetter" />
|
||||
</RelativeLayout>
|
||||
|
||||
<Button android:id="@+id/main_menu_join"
|
||||
<RelativeLayout android:id="@+id/main_menu_join"
|
||||
style="@style/MetroTile"
|
||||
android:layout_margin="5px"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:onClick="joinButton"
|
||||
android:text="Button 4" />
|
||||
android:onClick="joinButton">
|
||||
|
||||
<TextView
|
||||
style="@style/MetroTileText"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:text="Button 4" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -83,7 +126,7 @@
|
||||
<!-- <ImageView
|
||||
android:id="@+id/paragraph"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/partest" /> -->
|
||||
|
||||
+10
-1
@@ -3,9 +3,18 @@
|
||||
<!-- MAIN MENU STYLES: -->
|
||||
<style name="MetroTile">
|
||||
<item name="android:background">@drawable/metro_background</item>
|
||||
<item name="android:textColor">#ffffff</item>
|
||||
</style>
|
||||
|
||||
<style name="MetroTileText" parent="@android:style/TextAppearance">
|
||||
<item name="android:textColor">#ffffff</item>
|
||||
<item name="android:gravity">center</item>
|
||||
</style>
|
||||
|
||||
<style name="MetroTileText_bg" parent="MetroTileText">
|
||||
<item name="android:background">#80303030</item>
|
||||
</style>
|
||||
|
||||
|
||||
<!-- EVENT VIEW STYLES: -->
|
||||
<style name="BigHeader">
|
||||
<item name="android:textSize">20sp</item>
|
||||
|
||||
@@ -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