|
@@ -1,17 +1,10 @@
|
|
|
package com.example.yiupang.freefoodfinder;
|
|
package com.example.yiupang.freefoodfinder;
|
|
|
|
|
|
|
|
-import android.content.Intent;
|
|
|
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
|
-import android.view.LayoutInflater;
|
|
|
|
|
import android.view.View;
|
|
import android.view.View;
|
|
|
-import android.view.ViewGroup;
|
|
|
|
|
import android.widget.Button;
|
|
import android.widget.Button;
|
|
|
import android.widget.EditText;
|
|
import android.widget.EditText;
|
|
|
-import android.support.v4.app.Fragment;
|
|
|
|
|
-
|
|
|
|
|
-import java.security.AccessController;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
|
|
public class CreateEventScreen1 extends AppCompatActivity {
|
|
public class CreateEventScreen1 extends AppCompatActivity {
|
|
|
|
|
|
|
@@ -20,8 +13,6 @@ public class CreateEventScreen1 extends AppCompatActivity {
|
|
|
{
|
|
{
|
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
|
setContentView(R.layout.activity_create_event_screen1);
|
|
setContentView(R.layout.activity_create_event_screen1);
|
|
|
- // View view = inflater.inflate(R.layout.create_event, container, false);
|
|
|
|
|
- // View view = inflater.inflate(R.layout.activity_create_event_screen1, container, false);
|
|
|
|
|
final Event newEvent = new Event();
|
|
final Event newEvent = new Event();
|
|
|
|
|
|
|
|
Button button = (Button) findViewById(R.id.button_create);
|
|
Button button = (Button) findViewById(R.id.button_create);
|
|
@@ -35,6 +26,7 @@ public class CreateEventScreen1 extends AppCompatActivity {
|
|
|
button.setOnClickListener(new View.OnClickListener() {
|
|
button.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v){
|
|
public void onClick(View v){
|
|
|
|
|
+
|
|
|
String title = titleEdit.getText().toString();
|
|
String title = titleEdit.getText().toString();
|
|
|
String date = dateEdit.getText().toString();
|
|
String date = dateEdit.getText().toString();
|
|
|
String time = timeEdit.getText().toString();
|
|
String time = timeEdit.getText().toString();
|
|
@@ -43,10 +35,7 @@ public class CreateEventScreen1 extends AppCompatActivity {
|
|
|
String desc = descEdit.getText().toString();
|
|
String desc = descEdit.getText().toString();
|
|
|
|
|
|
|
|
newEvent.setName(title);
|
|
newEvent.setName(title);
|
|
|
- //newEvent.setTime(null);
|
|
|
|
|
newEvent.setPlace(place);
|
|
newEvent.setPlace(place);
|
|
|
- //newEvent.setLatitude(0);
|
|
|
|
|
- //newEvent.setLongitude(0);
|
|
|
|
|
newEvent.setDate(date);
|
|
newEvent.setDate(date);
|
|
|
newEvent.setTime(time);
|
|
newEvent.setTime(time);
|
|
|
newEvent.setFoodType(food);
|
|
newEvent.setFoodType(food);
|
|
@@ -55,12 +44,12 @@ public class CreateEventScreen1 extends AppCompatActivity {
|
|
|
HttpCall httpr = new HttpCall();
|
|
HttpCall httpr = new HttpCall();
|
|
|
httpr.setMethodType(HttpCall.PUT);
|
|
httpr.setMethodType(HttpCall.PUT);
|
|
|
httpr.setBody(newEvent);
|
|
httpr.setBody(newEvent);
|
|
|
- httpr.setUrl("https://free-food-finder.herokuapp.com/events");
|
|
|
|
|
|
|
+ httpr.setUrl("http://free-food-finder.herokuapp.com/events");
|
|
|
new HttpRequest(){
|
|
new HttpRequest(){
|
|
|
@Override
|
|
@Override
|
|
|
public void onResponse(Object response, int code)
|
|
public void onResponse(Object response, int code)
|
|
|
{
|
|
{
|
|
|
- finishActivity(0);
|
|
|
|
|
|
|
+ finish();
|
|
|
}
|
|
}
|
|
|
}.execute(httpr);
|
|
}.execute(httpr);
|
|
|
|
|
|