Permalink
Browse files

OAuth and Info added

  • Loading branch information...
1 parent 8ffdc08 commit 911387f4cfc68bd168bed48c42c9bd7cde101c01 @aknoxx committed Jun 12, 2011
View
@@ -8,6 +8,8 @@
<attribute name="javadoc_location" value="jar:platform:/resource/StatusNetAndroid/lib/twitter4j-core-2.2.2-javadoc.jar!/"/>
</attributes>
</classpathentry>
+ <classpathentry kind="lib" path="lib/signpost-commonshttp4-1.2.jar"/>
+ <classpathentry kind="lib" path="lib/signpost-core-1.2.jar"/>
<classpathentry kind="src" path="ActionBarWidget_src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
View
@@ -42,6 +42,23 @@
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
+ <activity android:name=".activities.LoginActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar">
+ </activity>
+ <activity android:name=".activities.OAuthActivity"
+ android:label="@string/app_name">
+ <intent-filter>
+ <action android:name="android.intent.action.VIEW" />
+ <category android:name="android.intent.category.DEFAULT" />
+ <category android:name="android.intent.category.BROWSABLE" />
+ <data android:scheme="bloa-app" android:host="twitt" />
+ </intent-filter>
+ </activity>
+ <activity android:name=".activities.InfoActivity"
+ android:label="@string/app_name"
+ android:theme="@android:style/Theme.NoTitleBar">
+ </activity>
<activity android:name=".activities.SearchActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/container"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <com.markupartist.android.widget.ActionBar
+ android:id="@+id/actionbar"
+ style="@style/ActionBar"
+ />
+ <TextView android:text="You are logged in as"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="10dp"
+ android:paddingTop="10dp"
+ />
+ <TextView android:text="Username"
+ android:id="@+id/tv_Username"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="30dp"
+ />
+ <TextView android:text="Network"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="10dp"
+ android:paddingTop="10dp"
+ />
+ <TextView android:text="network"
+ android:id="@+id/tv_Network"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="30dp"
+ />
+ <TextView android:text="Server Base-Url"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="10dp"
+ android:paddingTop="10dp"
+ />
+ <TextView android:text="http:..."
+ android:id="@+id/tv_BaseUrl"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:paddingLeft="30dp"
+ android:paddingBottom="20dp"
+ />
+ <Button
+ android:id="@+id/btn_logout"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Logout"
+ />
+</LinearLayout>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout android:id="@+id/container"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ >
+ <com.markupartist.android.widget.ActionBar
+ android:id="@+id/actionbar"
+ style="@style/ActionBar"
+ />
+ <Button xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/btn_login"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="Login..." />
+</LinearLayout>
File renamed without changes.
@@ -0,0 +1,48 @@
+package at.tuwien.dsg.activities;
+
+import com.markupartist.android.widget.ActionBar;
+import com.markupartist.android.widget.ActionBar.Action;
+import com.markupartist.android.widget.ActionBar.IntentAction;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import at.tuwien.dsg.R;
+
+public class InfoActivity extends Activity {
+
+ private ActionBar actionBar;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.info_view);
+ actionBar = (ActionBar) findViewById(R.id.actionbar);
+
+ actionBar.setTitle("Info");
+ final Action requestsIntentAction = new IntentAction(this, new Intent(this, TweetflowActivity.class), R.drawable.requests);
+
+ actionBar.addAction(requestsIntentAction);
+
+
+ Button btnLogout = (Button) findViewById(R.id.btn_logout);
+ btnLogout.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+
+ // TODO: do logout stuff
+
+ redirectToLogin();
+ }
+ });
+ }
+
+ private void redirectToLogin() {
+ startActivity(new Intent(this, LoginActivity.class));
+ }
+}
@@ -0,0 +1,14 @@
+package at.tuwien.dsg.activities;
+
+// You either come up with your own MyKeys class or you take out the extension and un-comment the values here
+// with your own token and key. Let's see how this works as far as me not giving away my stuff all the time!
+public class Keys { //extends MyKeys {
+ //public static final String TWITTER_CONSUMER_KEY = "wfRZ0ziRJOS07W9KRmAtLQ";
+ //public static final String TWITTER_CONSUMER_SECRET = "PQzIniSepykkKpPQog2a7Se9I0mX0rLasPIgiygaPkE";
+ /*
+ public static final String TWITTER_CONSUMER_KEY = "9a74ad0a805737218ba3da94a0236b53";
+ public static final String TWITTER_CONSUMER_SECRET = "dc3f43cba9e36cb84725f0f8d654ed6e";
+ */
+ public static final String TWITTER_CONSUMER_KEY = "d627a2882d5e28dc5835a92f1e46760e";
+ public static final String TWITTER_CONSUMER_SECRET = "84ee86ede714b965344186c5dd74d330";
+}
@@ -125,7 +125,7 @@ void OAuthLogin() {
@Override
public void onDestroy() {
- Log.i("OAUTH", "onDestroy()");
+ Log.i("OAuthActivity", "onDestroy()");
Toast.makeText(this, "destroy", Toast.LENGTH_LONG).show();
super.onDestroy();
}
@@ -0,0 +1,39 @@
+package at.tuwien.dsg.activities;
+
+import com.markupartist.android.widget.ActionBar;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.widget.Button;
+import at.tuwien.dsg.R;
+
+public class LoginActivity extends Activity {
+
+ private ActionBar actionBar;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ setContentView(R.layout.login_view);
+
+ actionBar = (ActionBar) findViewById(R.id.actionbar);
+
+ actionBar.setTitle("Login");
+
+ Button btnLogin = (Button) findViewById(R.id.btn_login);
+ btnLogin.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ redirectToTweetFlowTimeline();
+ }
+ });
+ }
+
+ private void redirectToTweetFlowTimeline() {
+ startActivity(new Intent(this, OAuthActivity.class));
+ }
+}
Oops, something went wrong.

0 comments on commit 911387f

Please sign in to comment.