Skip to content

Commit

Permalink
Added user email on actionpicker page
Browse files Browse the repository at this point in the history
  • Loading branch information
David Baumgold committed Jul 15, 2010
1 parent 7188a1e commit 23b91a5
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 21 deletions.
8 changes: 0 additions & 8 deletions res/layout-land/logout_button.xml

This file was deleted.

21 changes: 21 additions & 0 deletions res/layout-land/logout_layout.xml
@@ -0,0 +1,21 @@
<?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="wrap_content"
android:id="@+id/logout_layout"
android:layout_alignParentBottom="true"
android:visibility="gone">
<TextView
android:text="email placeholder"
android:id="@+id/user_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button
android:text="@string/logout_label"
android:id="@+id/logout_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginRight="20sp" />
</LinearLayout>
10 changes: 0 additions & 10 deletions res/layout-port/logout_button.xml

This file was deleted.

22 changes: 22 additions & 0 deletions res/layout-port/logout_layout.xml
@@ -0,0 +1,22 @@
<?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="wrap_content"
android:id="@+id/logout_layout"
android:layout_alignParentBottom="true"
android:orientation="vertical">
<TextView
android:text="email placeholder"
android:id="@+id/user_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"/>
<Button
android:text="@string/logout_label"
android:id="@+id/logout_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20sp"
android:layout_marginRight="20sp" />
</LinearLayout>
4 changes: 2 additions & 2 deletions res/layout/actionpicker.xml
Expand Up @@ -8,8 +8,8 @@
android:orientation="vertical">

<include
android:id="@+id/logout_button"
layout="@layout/logout_button" />
android:id="@+id/logout_layout"
layout="@layout/logout_layout" />

<TableLayout
android:layout_width="wrap_content"
Expand Down
26 changes: 25 additions & 1 deletion src/edu/brandeis/jbs/rh/ActionPicker.java
@@ -1,14 +1,34 @@
package edu.brandeis.jbs.rh;

import java.io.IOException;
import java.io.InputStream;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.protocol.ClientContext;
import org.apache.http.protocol.BasicHttpContext;
import org.w3c.dom.Document;
import org.xml.sax.SAXException;

import android.app.Activity;
import android.net.http.AndroidHttpClient;
import android.os.AsyncTask;
import android.os.Bundle;
import android.content.Intent;
import android.content.SharedPreferences;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.OrientationEventListener;
import android.widget.Button;
import android.widget.TextView;

public class ActionPicker extends Activity implements OnClickListener {

private SharedPreferences settings;
private Button whiteboardsButton;
private Button contractButton;
Expand All @@ -19,6 +39,11 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.actionpicker);

settings = getSharedPreferences(RoommateHelperHttpClient.PREFS_FILE, MODE_PRIVATE);

TextView user_email = (TextView)findViewById(R.id.user_email);
user_email.setText(settings.getString("email", ""));

whiteboardsButton = (Button) findViewById(R.id.actionpicker_whiteboards_button);
whiteboardsButton.setOnClickListener(this);
contractButton = (Button) findViewById(R.id.contract_button);
Expand All @@ -40,7 +65,6 @@ public void onClick(View view) {
startActivity(i);
break;
case R.id.logout_button:
settings = getSharedPreferences(RoommateHelperHttpClient.PREFS_FILE, MODE_PRIVATE);
SharedPreferences.Editor editor = settings.edit();
editor.remove("email");
editor.remove("password");
Expand Down

0 comments on commit 23b91a5

Please sign in to comment.