Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' of github.com:canoo/HackergartenApp

  • Loading branch information...
commit ef243b21951dd438a797b19bfa2e0433d2fd641f 2 parents 2d45ef0 + 3380f73
@HamletDRC HamletDRC authored
View
11 AndroidManifest.xml
@@ -2,9 +2,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.hackergarten.android.app" android:versionCode="1"
android:versionName="1.0">
- <uses-sdk android:minSdkVersion="10" />
+ <uses-sdk android:targetSdkVersion="10" />
- <application android:icon="@drawable/icon" android:label="@string/app_name">
+ <application
+ android:icon="@drawable/icon"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
+
<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
@@ -13,10 +17,11 @@
</intent-filter>
</activity>
<activity android:name=".RegisterActivity" />
+ <activity android:name=".EventDetailActivity" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
-</manifest>
+</manifest>
View
BIN  res/drawable/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
65 res/layout/event_detail.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+<TextView
+ android:id="@+id/eventDetailSubject"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/test_event_detail"
+ android:textSize="20dp"
+ />
+
+<TableLayout android:id="@+id/eventDetailTable" android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <TableRow android:id="@+id/tableRow1" android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <TextView
+ android:layout_height="wrap_content"
+ android:text="@string/event_detail_location"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent" />
+ <EditText
+ android:id="@+id/eventDetailLocation"
+ android:layout_height="wrap_content"
+ android:layout_width="200dp"
+ android:editable="false" />
+ </TableRow>
+ <TableRow android:id="@+id/tableRow2" android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <TextView
+ android:layout_height="wrap_content"
+ android:text="@string/event_detail_description"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent" />
+ <EditText
+ android:id="@+id/eventDetailDescription"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:editable="false" />
+ </TableRow>
+ <TableRow android:id="@+id/tableRow3" android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <TextView
+ android:layout_height="wrap_content"
+ android:text="@string/event_detail_time"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent" />
+ <EditText
+ android:id="@+id/eventDetailTime"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:editable="false" />
+ </TableRow>
+ <TableRow android:id="@+id/tableRow4" android:layout_width="fill_parent" android:layout_height="wrap_content">
+ <TextView
+ android:layout_height="wrap_content"
+ android:text="@string/event_detail_initiator"
+ android:textAppearance="?android:attr/textAppearanceMedium"
+ android:layout_width="match_parent" />
+ <EditText
+ android:id="@+id/eventDetailInitiator"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:editable="false" />
+ </TableRow>
+</TableLayout>
+</LinearLayout>
View
8 res/values/strings.xml
@@ -16,8 +16,16 @@
<string name="register_success">Look at you, Hacker, we got you registered.</string>
<string name="checkin">Check In!</string>
+ <string name="event_detail_location">Location</string>
+ <string name="event_detail_description">Description</string>
+ <string name="event_detail_time">Time</string>
+ <string name="event_detail_initiator">Initiator</string>
+
<string name="test_event_subject">Android Hackergarten @Canoo</string>
<string name="test_event_description">The goal of this Hackergarten is to write a base Android Hackergarten app.</string>
<string name="test_event_date">28.9.2011</string>
+ <string name="test_event_detail">Android Hackergarten</string>
+
+
</resources>
View
4 src/net/hackergarten/android/app/EventArrayListAdapter.java
@@ -52,6 +52,10 @@ public void setEntries(List<Event> entries) {
this.entries = entries;
notifyObserversChanged();
}
+
+ public List<Event> getEntries() {
+ return entries;
+ }
// Adapter impl.
View
25 src/net/hackergarten/android/app/EventDetailActivity.java
@@ -1,13 +1,32 @@
package net.hackergarten.android.app;
+import net.hackergarten.android.app.model.Event;
import android.app.Activity;
import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
public class EventDetailActivity extends Activity {
- /** Called when the activity is first created. */
- @Override
+
+ @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
+
+ Event event = (Event) getIntent().getExtras().get("event");
+
+ View detailView = getLayoutInflater().inflate(R.layout.event_detail, null);
+ TextView subjectView = (TextView) detailView.findViewById(R.id.eventDetailSubject);
+ subjectView.setText(event.getSubject());
+ TextView locationView = (TextView) detailView.findViewById(R.id.eventDetailLocation);
+ locationView.setText(event.getLocation());
+ TextView descriptionView = (TextView) detailView.findViewById(R.id.eventDetailDescription);
+ descriptionView.setText(event.getDescription());
+ TextView timeView = (TextView) detailView.findViewById(R.id.eventDetailTime);
+ timeView.setText(event.getTimeUST().toLocaleString());
+ TextView initiatorView = (TextView) detailView.findViewById(R.id.eventDetailInitiator);
+ initiatorView.setText(event.getInitiator());
+
+ setContentView(detailView);
}
+
}
View
16 src/net/hackergarten/android/app/MainActivity.java
@@ -11,6 +11,8 @@
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
@@ -30,6 +32,16 @@ public void onCreate(Bundle savedInstanceState) {
LinearLayout listLayout = (LinearLayout) getLayoutInflater().inflate(R.layout.main, null);
ListView listView = (ListView) listLayout.findViewById(R.id.eventListView);
fEventAdapter = new EventArrayListAdapter(this, getLayoutInflater());
+ listView.setOnItemClickListener(new OnItemClickListener() {
+
+ public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+ Event event = fEventAdapter.getEntries().get(position);
+ Intent intent = new Intent(MainActivity.this, EventDetailActivity.class);
+ intent.putExtra("event", event);
+ startActivity(intent);
+ }
+
+ });
listView.setAdapter(fEventAdapter);
@@ -73,7 +85,7 @@ public void onFailure(final Throwable t) {
runOnUiThread(new Runnable() {
public void run() {
- Toast.makeText(MainActivity.this, "Failed to query server.", Toast.LENGTH_LONG);
+ Toast.makeText(MainActivity.this, "Failed to contact server.", Toast.LENGTH_LONG).show();
Log.e(MainActivity.class.getName(), "Failed to contact server.", t);
}
});
@@ -83,4 +95,4 @@ public void run() {
});
}
-}
+}
View
3  src/net/hackergarten/android/app/model/Event.java
@@ -1,8 +1,9 @@
package net.hackergarten.android.app.model;
+import java.io.Serializable;
import java.util.Date;
-public class Event {
+public class Event implements Serializable {
private String id;
private String location;
Please sign in to comment.
Something went wrong with that request. Please try again.