浏览代码

Revised Create Event Screen

Zachary Hatton 9 年之前
父节点
当前提交
a3c33bf850

+ 12 - 12
app/src/main/java/com/example/yiupang/freefoodfinder/CreateEventScreen.java

@@ -1,7 +1,7 @@
 package com.example.yiupang.freefoodfinder;
 
 /**
- * Created by Acer on 5/26/2017.
+ * Created by Zachary Hatton on 5/26/2017.
  */
 
 import android.content.Intent;
@@ -13,20 +13,22 @@ import android.view.View;
 import android.view.ViewGroup;
 import android.widget.EditText;
 import android.widget.TextView;
+import android.widget.Button;
+import android.support.v4.app.Fragment;
 
 
 import java.util.ArrayList;
 
-public class CreateEventScreen extends android.support.v4.app.Fragment{
+public class CreateEventScreen extends Fragment{
+
 
-    @Nullable
     @Override
-    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState)
+    public View onCreateView(LayoutInflater inflater,  ViewGroup container, Bundle savedInstanceState)
     {
         View view = inflater.inflate(R.layout.create_event, container, false);
-        Event newEvent = new Event();
+        //Event newEvent = new Event();
 
-        EditText editText = (EditText) view.findViewById(R.id.box1);
+        /* EditText editText = (EditText) view.findViewById(R.id.box1);
         editText.setOnEditorActionListener(new EditText.OnEditorActionListener() {
             @Override
             public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
@@ -35,13 +37,11 @@ public class CreateEventScreen extends android.support.v4.app.Fragment{
                 handled = true;
                 return handled;
             }
-        });
+        }); */
+
+        //Button button = (Button) view.findViewById(R.id.button_create);
+        //onClickListener(view);
 
         return view;
     }
-
-
-
-
-
 }

+ 110 - 7
app/src/main/res/layout/create_event.xml

@@ -1,14 +1,117 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <TextView
+        android:id = "@+id/creatorTitle"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="Creator:"
+        android:layout_column="0"
+        android:layout_row="0"/>
+
+    <TextView
+        android:id="@+id/dateTitle"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="Date:"
+        android:ems="10"
+        android:layout_column="0"
+        android:layout_row="1"
+        />
+
+    <TextView
+        android:id="@+id/timeTitle"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="Time:"
+        android:layout_column="0"
+        android:layout_row="2" />
+
+    <TextView
+        android:id="@+id/placeTitle"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="Place:"
+        android:layout_column="0"
+        android:layout_row="3" />
+
+    <TextView
+        android:id="@+id/foodTitle"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="Food:"
+        android:layout_column="0"
+        android:layout_row="4" />
+
+    <TextView
+        android:id="@+id/descTitle"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:text="Description:"
+        android:layout_column="0"
+        android:layout_row="5" />
+
+    <EditText
+        android:id="@+id/creatortext"
+        android:layout_width="255dp"
+        android:layout_height="wrap_content"
+        android:layout_column="1"
+        android:layout_row="0"
+        android:ems="10"
+        android:inputType="textPersonName" />
+
+    <EditText
+        android:id="@+id/datetext"
+        android:layout_width="255dp"
+        android:layout_height="wrap_content"
+        android:layout_column="1"
+        android:layout_row="1"
+        android:ems="10"
+        android:inputType="textPersonName" />
+
+    <EditText
+        android:id="@+id/timetext"
+        android:layout_width="255dp"
+        android:layout_height="wrap_content"
+        android:layout_column="1"
+        android:layout_row="2"
+        android:ems="10"
+        android:inputType="textPersonName" />
+
+    <EditText
+        android:id="@+id/placetext"
+        android:layout_width="255dp"
+        android:layout_height="wrap_content"
+        android:layout_column="1"
+        android:layout_row="3"
+        android:ems="10"
+        android:inputType="textPersonName" />
+
+    <EditText
+        android:id="@+id/foodtext"
+        android:layout_width="255dp"
+        android:layout_height="wrap_content"
+        android:layout_column="1"
+        android:layout_row="4"
+        android:ems="10"
+        android:inputType="textPersonName" />
 
     <EditText
-        android:id = "@+id/box1"
-        android:layout_width="match_parent"
+        android:id="@+id/descriptiontext"
+        android:layout_width="255dp"
         android:layout_height="wrap_content"
-        android:inputType="text"
-        android:imeOptions = "actionSend"/>
+        android:layout_column="1"
+        android:layout_row="5"
+        android:ems="10"
+        android:inputType="textPersonName" />
 
+    <Button
+        android:id="@+id/button_create"
+        android:layout_width="wrap_content"
+        android:layout_height= "wrap_content"
+        android:text = "Create Event" />
 
-</LinearLayout>
+</GridLayout>

+ 1 - 0
app/src/main/res/layout/event_details_screen.xml

@@ -106,4 +106,5 @@
         android:layout_row="5"
         android:ems="10"
         android:inputType="textPersonName" />
+
 </GridLayout>