@@ -2,9 +2,14 @@

import android.app.Fragment;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
@@ -14,29 +19,75 @@
*/
public class ProfileViewerFragment extends Fragment {

private static final String KEY_FIRST_NAME = "key_fname";
private static final String KEY_LAST_NAME = "key_lname";
private static final String KEY_TAG_LINE = "key_tline";
private static final String KEY_PHONE_NUMBER = "key_pnum";
private static final String KEY_EMAIL = "key_email";
private static final String KEY_LOCATION = "key_loc";
private static final String KEY_PICTURE_URL = "key_purl";
private static final String KEY_LINKEDIN_ID = "key_linid";
private static final String KEY_DATE_MET = "key_dmet";


public static ProfileViewerFragment create(PersonProfile profile) {
ProfileViewerFragment fragment = new ProfileViewerFragment();
Bundle bundle = new Bundle();

bundle.putString(KEY_FIRST_NAME, profile.getFirst_name());
bundle.putString(KEY_LAST_NAME, profile.getLast_name());
// bundle.putString(KEY_EMAIL, profile.getEmail());
// bundle.putString(KEY_PHONE_NUMBER, profile.getPhoneNumber());
// bundle.putString(KEY_LOCATION, profile.getLocation());
bundle.putString(KEY_TAG_LINE, profile.getTag_line());
bundle.putString(KEY_PICTURE_URL, profile.getPicture_url());
bundle.putString(KEY_LINKEDIN_ID, profile.getUser_id());

fragment.setArguments(bundle);
return fragment;
}

private PersonProfile profile;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Bundle args = getArguments();

profile = new PersonProfile(args.getString(KEY_FIRST_NAME),
args.getString(KEY_LAST_NAME),
args.getString(KEY_TAG_LINE),
args.getString(KEY_LINKEDIN_ID),
args.getString(KEY_PICTURE_URL));
}

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
setHasOptionsMenu(true);
return inflater.inflate(R.layout.profile_page, container, false);
}

@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
menu.findItem(R.id.profileLink).setVisible(false);
menu.findItem(R.id.addListLink).setVisible(false);

((Toolbar)getActivity().findViewById(R.id.toolbar)).setTitle("");
getActivity().findViewById(R.id.toolbar).setElevation(0);

((Toolbar)(getActivity().findViewById(R.id.toolbar))).setTitle("");
((ActionBarActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true);
((TextView) getActivity().findViewById(R.id.profileName)).setText("Paula Barcante");
((TextView)getActivity().findViewById(R.id.profileTagLine)).setText("UX Designer at Amazon");

super.onCreateOptionsMenu(menu, inflater);
}

@Override
public void onPause() {
super.onPause();
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);

getActivity().findViewById(R.id.toolbar).setElevation(0);
((TextView)getActivity().findViewById(R.id.profileName)).setText(profile.getFullName());
((TextView)getActivity().findViewById(R.id.profileTagLine)).setText(profile.getTag_line());
// ((TextView)getActivity().findViewById(R.id.phonenum)).setText(profile.getPhoneNumber());
// ((TextView)getActivity().findViewById(R.id.email)).setText(profile.getEmail());
// ((TextView)getActivity().findViewById(R.id.location)).setText(profile.location());
}
}
@@ -1,6 +1,7 @@
package com.angelhack.handshake;

import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -77,8 +78,7 @@ private void onApiSuccess(JSONObject json) {
String picUrl = json.getString("pictureUrl");

Log.d(TAG, "fName = " + fName + ", lName = " + lName + ", tagline = " + tagline + ", id = " + id + ", picUrl = " + picUrl);

me = new PersonProfile(fName, lName, tagline, id, picUrl);
me = new PersonProfile(fName, lName, tagline, id, picUrl, BluetoothAdapter.getDefaultAdapter().getAddress());

} catch (JSONException e) {
onApiError("Could not parse data");
@@ -87,7 +87,7 @@ private void onApiSuccess(JSONObject json) {

Log.d(TAG, "HITTING API");
HandshakeAPI api = HandshakeFactory.get();
api.signup(me.user_id, me.first_name, me.last_name, me.picture_url, me.tag_line, new Callback<Void>() {
api.signup(me.user_id, me.first_name, me.last_name, me.picture_url, me.tag_line, me.mac_address, new Callback<Void>() {
@Override
public void success(Void aVoid, Response response) {
Log.d(TAG, "SUCCESS HEROKU");
@@ -8,8 +8,7 @@
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:background="#FFFFFF"
android:orientation="horizontal"
android:clickable="true">
android:orientation="horizontal">

<ImageView android:id="@+id/image1"
android:layout_width="40dp"
@@ -47,7 +46,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="LINKEDIN" />
android:text="LINKEDIN"
android:clickable="true"/>

</LinearLayout>

@@ -2,8 +2,10 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/profile"
android:orientation="vertical"
android:background="#FFFFFF"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:clickable="true">

<LinearLayout
android:orientation="vertical"
@@ -71,6 +73,7 @@
android:gravity="center_horizontal">

<TextView
android:id="@+id/phonenum"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
@@ -109,6 +112,7 @@
android:gravity="center_horizontal">

<TextView
android:id="@+id/email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
@@ -146,6 +150,7 @@
android:gravity="center_horizontal">

<TextView
android:id="@+id/location"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="start"
@@ -198,7 +203,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ADD"
android:text="CONNECT"
android:textSize="10pt"
android:textColor="#2196F3"/>
</LinearLayout>
@@ -218,7 +223,6 @@
<ImageView
android:layout_width="40dp"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:gravity="bottom"
android:tint="#2196F3"
android:src="@drawable/ic_action_content_clear"/>

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered

This file was deleted.

Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

@@ -0,0 +1,33 @@
from tornado.ioloop import IOLoop
from tornado.web import RequestHandler, Application, url
import pycps
import json

class ConnectionRegisterHandler(RequestHandler):
def post(self):
user_id = self.get_argument('user_id')
devices = self.get_argument('devices')
session_db = pycps.Connection('tcp://cloud-us-0.clusterpoint.com:9007', 'sessions', 'vmmonkey@gmail.com', 'monkey', '100642')

try:
response = session_db.retrieve(devices)
except pycps.APIError as e:
print(e)
if e.code == 2824:
print("Requested non-existing id(s): {0}".format(', '.join(e.document_id)))
return

try:
if response.get_documents:
user_id = response.get_documents().items()[0]
session_db.delete(user_id)
self.write('success')
self.finish()
else:
session_db.insert({user_id : {
'devices' : devices
}
})
self.finish()
except pycps.APIError as e:
return
Binary file not shown.
@@ -5,19 +5,20 @@
from user_handler import UserHandler
from user_sign_up_handler import UserSignUpHandler
from multi_user_handler import MultiUserHandler
# from connection_handler import ConnectionRegisterHandler
from connection_register_handler import ConnectionRegisterHandler

class MainHandler(RequestHandler):
def get(self):
self.write("Hello handshake")
self.finish()

def make_app():
return Application([
url(r"/", MainHandler),
url(r"/user/([0-9]+)/profile", UserHandler),
url(r"/user/([0-9]+)/connections", MultiUserHandler),
url(r"/user/signup", UserSignUpHandler),
# url(r"/connection/register", ConnectionRegisterHandler),
url(r"/connection/register", ConnectionRegisterHandler),
])

def main():
Binary file not shown.
BIN -48 Bytes (97%) handshake_server/user_handler.pyc
Binary file not shown.
@@ -2,11 +2,14 @@
from tornado.web import RequestHandler, Application, url
import pycps
import json
import logging

class UserSignUpHandler(RequestHandler):
def post(self):
user_id = self.get_argument('user_id')
con = pycps.Connection('tcp://cloud-us-0.clusterpoint.com:9007', 'users', 'vmmonkey@gmail.com', 'monkey', '100642')
user_id = self.get_argument('user_id')
logging.info(user_id)
print user_id
first_name = self.get_argument('first_name')
last_name = self.get_argument('last_name')
tag_line = self.get_argument('tag_line')
@@ -22,7 +25,6 @@ def post(self):
'last_name':last_name,
'tag_line':tag_line,
'picture_url':picture_url,
'phone_number':phone_number,
'email':email
}
}
Binary file not shown.