Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,6 @@ local.properties

# PDT-specific
.buildpath

# OSX files
.DS_Store
33 changes: 32 additions & 1 deletion AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,45 @@
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="org.missionassetfund.apps.android.activities.MainActivity"
android:name="org.missionassetfund.apps.android.activities.MAFDispatchActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.parse.ui.ParseLoginActivity"
android:label="@string/app_name"
android:launchMode="singleTop" >
<meta-data
android:name="com.parse.ui.ParseLoginActivity.APP_LOGO"
android:resource="@drawable/logo" />
<meta-data
android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_ENABLED"
android:value="true" />
<meta-data
android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_EMAIL_AS_USERNAME"
android:value="true" />
<meta-data
android:name="com.parse.ui.ParseLoginActivity.FACEBOOK_LOGIN_ENABLED"
android:value="false" />
<meta-data
android:name="com.parse.ui.ParseLoginActivity.TWITTER_LOGIN_ENABLED"
android:value="false" />
<meta-data
android:name="com.parse.ui.ParseLoginActivity.PARSE_SIGNUP_BUTTON_TEXT"
android:value="@string/parse_signup_button_text" />
<meta-data
android:name="com.parse.ui.ParseLoginActivity.PARSE_LOGIN_BUTTON_TEXT"
android:value="@string/parse_login_button_text" />
</activity>
<activity
android:name="org.missionassetfund.apps.android.activities.MainActivity"
android:label="@string/app_name"
android:launchMode="singleTop" >
</activity>
</application>

</manifest>
Binary file removed libs/android-support-v4.jar
Binary file not shown.
1 change: 1 addition & 0 deletions project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

# Project target.
target=android-19
android.library.reference.1=third-party-libs/ParseLoginUI
Binary file added res/drawable/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions res/menu/menu_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

<item
android:id="@+id/action_logout"
android:title="@string/action_logout">
</item>

</menu>
7 changes: 0 additions & 7 deletions res/values/app_config_sample.xml

This file was deleted.

6 changes: 5 additions & 1 deletion res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@
<string name="label_due_date">Due On</string>
<string name="sample_due_date">JUL 25</string>
<string name="sample_due_date_human">2 DAYS FROM NOW</string>
</resources>
<string name="action_logout">Log Out</string>
<string name="parse_signup_button_text">Create Account</string>
<string name="parse_login_button_text">Log In</string>

</resources>
1 change: 1 addition & 0 deletions src/org/missionassetfund/apps/android/MAFApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public void onCreate() {
// Initializing Parse
Parse.initialize(this, getString(R.string.parseApplicationId),
getString(R.string.parseClientId));
Parse.setLogLevel(Parse.LOG_LEVEL_DEBUG);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

package org.missionassetfund.apps.android.activities;

import com.parse.ui.ParseLoginDispatchActivity;

public class MAFDispatchActivity extends ParseLoginDispatchActivity {

@Override
protected Class<?> getTargetClass() {
return MainActivity.class;
}

}
50 changes: 47 additions & 3 deletions src/org/missionassetfund/apps/android/activities/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,33 @@
import org.missionassetfund.apps.android.R;
import org.missionassetfund.apps.android.fragments.DashboardFragment;

import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

import com.parse.ParseUser;

public class MainActivity extends FragmentActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

showDashboardFragment();
}

private void showDashboardFragment() {
showFragment(DashboardFragment.class);
}

@SuppressWarnings("rawtypes")
private void showFragment(Class activeFragmentClass) {
Class[] fragmentClasses = new Class[] {
Expand Down Expand Up @@ -52,4 +59,41 @@ private void showFragment(Class activeFragmentClass) {
}
transaction.commit();
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_main, menu);
return true;
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {

case R.id.action_logout:
logoutParse();
break;
default:
break;
}

return true;
}

private void logoutParse() {
ParseUser.logOut();

// FLAG_ACTIVITY_CLEAR_TASK only works on API 11, so if the user
// logs out on older devices, we'll just exit.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
Intent intent = new Intent(this, MAFDispatchActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
| Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} else {
finish();
}
}

}
2 changes: 1 addition & 1 deletion src/org/missionassetfund/apps/android/models/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.parse.ParseClassName;
import com.parse.ParseUser;

@ParseClassName("_User")
@ParseClassName("User")
public class User extends ParseUser {
public static final String NAME_KEY = "name";
public static final String PHONE_NUMBER_KEY = "phoneNumber";
Expand Down
12 changes: 12 additions & 0 deletions third-party-libs/ParseLoginUI/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.parse.ui"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

<application />

</manifest>
25 changes: 25 additions & 0 deletions third-party-libs/ParseLoginUI/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apply plugin: 'android-library'

dependencies {
compile project(':facebook-sdk:facebook')
compile 'com.android.support:support-v4:13.0.+'
compile fileTree(dir: 'libs', include: '*.jar')
}

android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
}

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
Binary file not shown.
17 changes: 17 additions & 0 deletions third-party-libs/ParseLoginUI/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

android.library=true
# Project target.
target=android-19
android.library.reference.1=../facebook-sdk/facebook

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true" android:color="@color/com_parse_ui_parse_login_help_button_label_push"/>
<item android:state_focused="true" android:color="@color/com_parse_ui_parse_login_help_button_label_focus"/>
<item android:color="@color/com_parse_ui_parse_login_help_button_label"/>

</selector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true" android:drawable="@color/com_parse_ui_facebook_login_button_push"/>
<item android:state_focused="true" android:drawable="@color/com_parse_ui_facebook_login_button_focus"/>
<item android:drawable="@color/com_parse_ui_facebook_login_button"/>

</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true" android:drawable="@color/com_parse_ui_parse_login_button_push"/>
<item android:state_focused="true" android:drawable="@color/com_parse_ui_parse_login_button_focus"/>
<item android:drawable="@color/com_parse_ui_parse_login_button"/>

</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">

<item android:state_pressed="true" android:drawable="@color/com_parse_ui_twitter_login_button_push"/>
<item android:state_focused="true" android:drawable="@color/com_parse_ui_twitter_login_button_focus"/>
<item android:drawable="@color/com_parse_ui_twitter_login_button"/>

</selector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/com_parse_ui_vertical_margin"
android:paddingLeft="@dimen/com_parse_ui_horizontal_margin"
android:paddingRight="@dimen/com_parse_ui_horizontal_margin"
android:paddingBottom="@dimen/com_parse_ui_vertical_margin"
android:gravity="center"
android:orientation="horizontal">

<include
layout="@layout/com_parse_ui_parse_login_form"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:layout_marginRight="@dimen/com_parse_ui_horizontal_margin"/>

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:gravity="center"
android:orientation="vertical">

<include layout="@layout/com_parse_ui_parse_login_third_party_section" />
</LinearLayout>
</LinearLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/com_parse_ui_vertical_margin"
android:paddingLeft="@dimen/com_parse_ui_horizontal_margin"
android:paddingRight="@dimen/com_parse_ui_horizontal_margin"
android:paddingBottom="@dimen/com_parse_ui_vertical_margin">

<include
layout="@layout/com_parse_ui_parse_login_help_form"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</FrameLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingTop="@dimen/com_parse_ui_vertical_margin"
android:paddingLeft="@dimen/com_parse_ui_horizontal_margin"
android:paddingRight="@dimen/com_parse_ui_horizontal_margin"
android:paddingBottom="@dimen/com_parse_ui_vertical_margin">

<include
layout="@layout/com_parse_ui_parse_signup_form"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</ScrollView>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/app_logo"
android:layout_gravity="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/com_parse_ui_app_logo"
android:contentDescription="@string/com_parse_ui_logo_content_description" />
Loading