Skip to content
Browse files

Redesign of homepage

  • Loading branch information...
1 parent 47fd5d0 commit 9fc3b6df50e57b9afad71959fef90627cb084da8 @immranderson immranderson committed
View
17 AndroidManifest.xml
@@ -16,21 +16,24 @@
android:name="com.hackerdojo.android.infoapp.EventActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
- <intent-filter>
- <action android:name="android.intent.action.MAIN" />
-
- <category android:name="android.intent.category.LAUNCHER" />
- </intent-filter>
</activity>
<activity
android:name="com.hackerdojo.android.infoapp.StaffActivity"
android:theme="@android:style/Theme.NoTitleBar" />
<activity
android:name="com.hackerdojo.android.infoapp.SubEventActivity"
- android:theme="@android:style/Theme.NoTitleBar"
- android:label="@string/title_activity_sub_event" >
+ android:label="@string/title_activity_sub_event"
+ android:theme="@android:style/Theme.NoTitleBar" >
</activity>
+ <activity
+ android:name="com.hackerdojo.android.infoapp.HelloGridView"
+ android:theme="@android:style/Theme.NoTitleBar" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
</application>
</manifest>
View
1 project.properties
@@ -9,3 +9,4 @@
# Project target.
target=android-14
+android.library.reference.1=../../Workspace/gridlayout_v7
View
BIN res - Shortcut.lnk
Binary file not shown.
View
BIN res/drawable-hdpi-v4/icon.png
Deleted file not rendered
View
0 ...-ldpi-v4/hacker_dojo_logo_transparent.png → ...ble-hdpi/hacker_dojo_logo_transparent.png
File renamed without changes
View
BIN res/drawable-hdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 ...-hdpi-v4/hacker_dojo_logo_transparent.png → ...ble-ldpi/hacker_dojo_logo_transparent.png
File renamed without changes
View
BIN res/drawable-ldpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable-mdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
0 res/drawable-ldpi-v4/icon.png → res/drawable-xhdpi/icon.png
File renamed without changes
View
BIN res/drawable/compass.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/compass_with_text.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/event_flag.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/event_flag_with_text.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/hacker_dojo_logo_transparent_2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/staff.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN res/drawable/staff_with_text.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
44 res/layout/event.xml
@@ -1,13 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:padding="10sp"
- >
- <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:orientation="vertical" android:gravity="center_vertical">
- <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#005500"></TextView>
- <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#990000" ></TextView>
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="10dp" >
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="vertical" >
+
+ <TextView
+ android:id="@+id/textView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="#005500" >
+ </TextView>
+
+ <TextView
+ android:id="@+id/textView2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="#990000" >
+ </TextView>
</LinearLayout>
- <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/black" android:layout_gravity="center_vertical" android:layout_marginLeft="10px"></TextView>
+
+ <TextView
+ android:id="@+id/textView3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:layout_marginLeft="10dp"
+ android:textColor="@android:color/black" >
+ </TextView>
+
</LinearLayout>
View
38 res/layout/main.xml
@@ -10,29 +10,20 @@
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_margin="10px"
- android:src="@drawable/hacker_dojo_logo_transparent"
+ android:layout_margin="10dp"
+ android:src="@drawable/hacker_dojo_logo_transparent_2"
/>
<ListView
android:id="@android:id/list"
- android:layout_width="wrap_content"
+ android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:divider="@android:color/darker_gray"
- android:dividerHeight="1px"
+ android:dividerHeight="1dp"
android:cacheColorHint="#00000000"
android:layout_weight="1"
/>
<TextView
- android:id="@android:id/empty"
- android:text="@string/emptyEvents"
- android:layout_height="fill_parent"
- android:layout_width="fill_parent"
- android:gravity="center_vertical|center_horizontal"
- android:textSize="16pt"
- android:layout_weight="1"
- />
- <TextView
android:id="@+id/empty"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
@@ -46,26 +37,5 @@
android:layout_height="wrap_content"
android:layout_weight="0"
>
- <Button
- android:id="@+id/eventsButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Events"
- android:layout_weight="2"
- />
- <Button
- android:id="@+id/staffButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Staff on Site"
- android:layout_weight="2"
- />
- <Button
- android:id="@+id/navigateButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Navigate to the Dojo"
- android:layout_weight="2"
- />
</LinearLayout>
</LinearLayout>
View
25 res/layout/maingrid.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@android:color/white"
+ android:orientation="vertical" >
+
+ <ImageView
+ android:id="@+id/top_image"
+ android:src="@drawable/hacker_dojo_logo_transparent_2"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <GridView
+ android:id="@+id/gridview"
+ android:layout_width="match_parent"
+ android:layout_height="0dip"
+ android:layout_weight="1"
+ android:columnWidth="100dp"
+ android:horizontalSpacing="20dp"
+ android:numColumns="auto_fit"
+ android:stretchMode="columnWidth"
+ android:verticalSpacing="20dp" />
+
+</LinearLayout>
View
45 res/layout/staff.xml
@@ -1,13 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:padding="10sp"
- >
- <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:orientation="horizontal" android:gravity="center_vertical">
- <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#005500" android:visibility="gone"></TextView>
- <TextView android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#005500" ></TextView>
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:padding="10dp" >
+
+ <LinearLayout
+ android:id="@+id/linearLayout1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:gravity="center_vertical"
+ android:orientation="horizontal" >
+
+ <TextView
+ android:id="@+id/textView1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="#005500"
+ android:visibility="gone" >
+ </TextView>
+
+ <TextView
+ android:id="@+id/textView2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="#005500" >
+ </TextView>
</LinearLayout>
- <TextView android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@android:color/black" android:layout_gravity="center_vertical|right" android:layout_marginLeft="10px"></TextView>
+
+ <TextView
+ android:id="@+id/textView3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical|right"
+ android:layout_marginLeft="10dp"
+ android:textColor="@android:color/black" >
+ </TextView>
+
</LinearLayout>
View
3 res/values/strings.xml
@@ -9,5 +9,8 @@
<string name="hello_world">Hello world!</string>
<string name="title_activity_sub_events">SubEventsActivity</string>
<string name="title_activity_sub">SubActivity</string>
+ <string name="navigate_button_label">Navigate to the Dojo!</string>
+ <string name="staff_button_label">Staff on Site</string>
+ <string name="event_button_label">Events</string>
</resources>
View
10 src/com/hackerdojo/android/infoapp/Event.java
@@ -8,10 +8,12 @@
private String title;
private String host;
private String location;
+ private String description; //add extended description for SubEvent Activity...
private int size;
public Date getStartDate() {
return startDate;
}
+
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
@@ -40,6 +42,14 @@ public void setLocation(String location) {
this.location = location;
}
+ public String getDescription(){
+ return description;
+ }
+
+ public void setDescription(String description){
+ this.description = description;
+ }
+
@Override
public int compareTo(Event another) {
Event anotherEvent = (Event) another;
View
4 src/com/hackerdojo/android/infoapp/EventActivity.java
@@ -68,8 +68,8 @@ public void onCreate(Bundle savedInstanceState) {
public void onResume() {
super.onResume();
- Button eventButton = (Button) findViewById(R.id.eventsButton);
- eventButton.setVisibility(View.GONE);
+ //Button eventButton = (Button) findViewById(R.id.eventsButton);
+ //eventButton.setVisibility(View.GONE);
if (Calendar.getInstance().getTimeInMillis()
- lastChecked.get().getTimeInMillis() > (1000 * 60 * 10)) { // 10
View
34 src/com/hackerdojo/android/infoapp/HackerDojoActivity.java
@@ -33,14 +33,14 @@ public void onCreate(Bundle savedInstanceState) {
public void onResume() {
super.onResume();
- Button eventsButton = (Button) findViewById(R.id.eventsButton);
- eventsButton.setOnClickListener(this);
-
- Button staffButton = (Button) findViewById(R.id.staffButton);
- staffButton.setOnClickListener(this);
-
- Button navigateButton = (Button) findViewById(R.id.navigateButton);
- navigateButton.setOnClickListener(this);
+// Button eventsButton = (Button) findViewById(R.id.eventsButton);
+// eventsButton.setOnClickListener(this);
+//
+// Button staffButton = (Button) findViewById(R.id.staffButton);
+// staffButton.setOnClickListener(this);
+//
+// Button navigateButton = (Button) findViewById(R.id.navigateButton);
+// navigateButton.setOnClickListener(this);
// hide dojo logo when sideways, takes up a lot of room
View dojoLogo = findViewById(R.id.imageView1);
@@ -56,15 +56,15 @@ public void onResume() {
public void onClick(View v) {
Log.i(TAG, "Button Click: " + v.getId());
switch (v.getId()) {
- case R.id.eventsButton:
- openEvents();
- break;
- case R.id.staffButton:
- openStaff();
- break;
- case R.id.navigateButton:
- openNavigation();
- break;
+// case R.id.eventsButton:
+// openEvents();
+// break;
+// case R.id.staffButton:
+// openStaff();
+// break;
+// case R.id.navigateButton:
+// openNavigation();
+// break;
default:
}
View
85 src/com/hackerdojo/android/infoapp/HelloGridView.java
@@ -0,0 +1,85 @@
+package com.hackerdojo.android.infoapp;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.ActivityNotFoundException;
+import android.content.Intent;
+import android.graphics.Point;
+import android.net.Uri;
+import android.os.Bundle;
+import android.util.DisplayMetrics;
+import android.view.Display;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.GridView;
+import android.widget.Toast;
+
+
+public class HelloGridView extends Activity {
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+
+ setContentView(R.layout.maingrid);
+
+
+ GridView gridview = (GridView) findViewById(R.id.gridview);
+ gridview.setAdapter(new ImageAdapter(this));
+
+ gridview.setOnItemClickListener(new OnItemClickListener()
+ {
+ public void onItemClick(AdapterView<?> parent, View v, int position, long id)
+ {
+ switch (position){
+
+ case 0: //Event
+ openEvents();
+ break;
+ case 1: //Staff Clock In
+ openStaff();
+ break;
+ case 2: //Navigate
+ openNavigation();
+ break;
+
+ }
+ //Toast.makeText(HelloGridView.this, "index = " + position, Toast.LENGTH_SHORT).show();
+
+ }
+ }
+ );
+ }
+
+
+ private void openEvents() {
+ Intent intent = new Intent(HelloGridView.this, EventActivity.class);
+ startActivity(intent);
+ }
+
+ private void openStaff() {
+ Intent intent = new Intent(HelloGridView.this, StaffActivity.class);
+ startActivity(intent);
+ }
+
+ private void openNavigation() {
+ Intent intent = new Intent(
+ Intent.ACTION_VIEW,
+ Uri.parse("google.navigation:q=599%20Fairchild%20Dr%2C%20Mountain%20View%2C%20ca"));
+ try {
+ startActivity(intent);
+ } catch(ActivityNotFoundException ex) {
+ AlertDialog.Builder builder = new AlertDialog.Builder(
+ this);
+ builder.setCancelable(true);
+ builder.setTitle("Hacker Dojo");
+ String message =
+ "599 Fairchild Dr\n" +
+ "Mountain View, CA 94041";
+ builder.setMessage(message);
+ builder.create().show();
+ }
+ }
+}
View
55 src/com/hackerdojo/android/infoapp/ImageAdapter.java
@@ -0,0 +1,55 @@
+package com.hackerdojo.android.infoapp;
+
+import android.content.Context;
+import android.util.DisplayMetrics;
+import android.view.Display;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.GridView;
+import android.widget.ImageView;
+
+public class ImageAdapter extends BaseAdapter {
+ private Context mContext;
+
+ public ImageAdapter(Context c) {
+ mContext = c;
+ }
+
+ public int getCount() {
+ return mThumbIds.length;
+ }
+
+ public Object getItem(int position) {
+ return null;
+ }
+
+ public long getItemId(int position) {
+ return 0;
+ }
+
+
+ // create a new ImageView for each item referenced by the Adapter
+ public View getView(int position, View convertView, ViewGroup parent) {
+ ImageView imageView;
+
+ if (convertView == null) { // if it's not recycled, initialize some attributes
+ imageView = new ImageView(mContext);
+ imageView.setLayoutParams(new GridView.LayoutParams(128, 128)); //change numbers to reflect image scaling size
+ imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
+ imageView.setPadding(8, 8, 8, 8);
+ } else {
+ imageView = (ImageView) convertView;
+ }
+
+ imageView.setImageResource(mThumbIds[position]);
+ return imageView;
+ }
+
+ // references to our images
+ private Integer[] mThumbIds = {
+
+ R.drawable.event_flag_with_text, R.drawable.staff_with_text, R.drawable.compass_with_text
+
+ };
+}
View
4 src/com/hackerdojo/android/infoapp/StaffActivity.java
@@ -51,8 +51,8 @@ public void onCreate(Bundle savedInstanceState) {
public void onResume() {
super.onResume();
- Button staffButton = (Button) findViewById(R.id.staffButton);
- staffButton.setVisibility(View.GONE);
+// Button staffButton = (Button) findViewById(R.id.staffButton);
+// staffButton.setVisibility(View.GONE);
// strange bug, events properly maintains state but staff doesn't

0 comments on commit 9fc3b6d

Please sign in to comment.
Something went wrong with that request. Please try again.