Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
<!-- Required by Google Analytics and Mixpanel -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<!-- Required for push notifications from GCM: http://developer.android.com/google/gcm/client.html -->
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<permission android:name="com.uwflow.flow_android.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.uwflow.flow_android.permission.C2D_MESSAGE" />

<application
android:name=".FlowApplication"
android:label="@string/app_name"
Expand Down Expand Up @@ -47,8 +53,17 @@
</activity>
<activity android:name="com.facebook.LoginActivity"
android:screenOrientation="portrait"/>
<receiver android:name=".broadcast_receiver.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.uwflow.flow_android" />
</intent-filter>
</receiver>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/>
<meta-data android:name="com.crashlytics.ApiKey" android:value="0cced89c07497c684c2bd8361b9395d97483cad0"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The following instructions are tested for Intellij on Mac OS X and Windows:

1. Ensure you have
[the latest Android SDKs and build tools installed](https://developer.android.com/sdk/index.html).
1. Install the [Google Play Services SDK](http://developer.android.com/google/play-services/setup.html#Install).
1. Create a file in the project root directory called `local.properties` and add the line `sdk.dir=/path/to/your/sdk`.
1. Download [Gradle](http://www.gradle.org/downloads) (tested with version 1.10).
1. Open Intellij (or Android Studio). Ensure you have the Gradle Intellij plugin.
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies {
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.1'
compile "com.mixpanel.android:mixpanel-android:4.0.0@aar"
compile 'com.crashlytics.android:crashlytics:1.+'
compile 'com.google.android.gms:play-services:4.0.30'
}

android {
Expand Down
19 changes: 19 additions & 0 deletions proguard-project.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,22 @@

# We're open-sourced anyway... let's make life easier :)
-dontobfuscate

# Don't strip away required classes from Google Play Services SDK.
# From http://developer.android.com/google/play-services/setup.html
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}

-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final *** NULL;
}

-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}

-keepnames class * implements android.os.Parcelable {
public static final ** CREATOR;
}
Binary file added res/drawable-xhdpi/ic_add_alert.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 43 additions & 3 deletions res/layout/course_class_row_item.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<TableRow xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="wrap_content">
<TextView android:id="@+id/col1" android:layout_gravity="fill" android:layout_weight="1" android:paddingLeft="10dp"/>
<TextView android:id="@+id/col2" android:layout_gravity="fill" android:layout_weight="1" />
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="3dp"
android:paddingBottom="3dp"
android:paddingLeft="10dp"
android:paddingRight="10dp">
<TextView
android:id="@+id/col1"
android:gravity="center|left"
android:text="LEC\n001"
android:layout_width="50dp"
android:layout_height="fill_parent"
android:textSize="18dp"/>
<TextView
android:id="@+id/col2"
android:text="7:00PM - 8:50PM\nMTWThFSSu\nMC 4059 - UW U\nByron Weber Becker"
android:layout_gravity="center_vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<LinearLayout
android:layout_gravity="center_vertical|right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/seats_available_textview"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:gravity="center|right"
android:text="0/0\nseats"
android:layout_weight="1" />
<ImageButton android:id="@+id/add_alert_button"
style="@style/Flow.StyledButton"
android:padding="5dp"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/blue_button"
android:layout_marginLeft="10dp"
android:src="@drawable/ic_add_alert" />
</LinearLayout>
</TableRow>
20 changes: 0 additions & 20 deletions res/layout/course_schedule.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="0dp" >
<!-- 3 columns -->
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/flow_blue">
<TextView android:text="Class Info"
android:textStyle="bold"
android:layout_weight="1"
android:textColor="@color/white"
android:paddingLeft="10dp"/>
<TextView android:text="Time and Location"
android:textStyle="bold"
android:layout_weight="1"
android:textColor="@color/white"/>
<!--<TextView android:text=" " android:textStyle="bold"/>-->
</TableRow>

<!-- Header divider -->
<View android:layout_height="2dip" android:background="#ff5ba7ea" />

</TableLayout>
</ScrollView>
<TextView android:text=""
Expand Down
2 changes: 1 addition & 1 deletion res/layout/profile_schedule_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
android:layout_height="match_parent"
android:gravity="center"
android:textColor="@color/grey_dark"
android:text="No schedule uploaded"
android:text="No class schedule available"
android:textSize="18dp"
android:visibility="gone"/>
</LinearLayout>
30 changes: 23 additions & 7 deletions src/com/uwflow/flow_android/MainFlowActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import com.uwflow.flow_android.network.FlowAsyncClient;
import com.uwflow.flow_android.nfc.SharableURL;
import com.uwflow.flow_android.util.FacebookUtilities;
import com.uwflow.flow_android.util.RegistrationIdUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONException;
import org.json.JSONObject;

Expand Down Expand Up @@ -154,8 +156,12 @@ public void onDrawerOpened(View view) {
mDrawerList.setOnItemClickListener(new DrawerItemClickListener());

if (savedInstanceState == null) {
Fragment initialFragment;
if (isUserLoggedIn) {
Bundle bundle = getIntent().getExtras();
String courseId = (bundle == null ? null : bundle.getString(Constants.COURSE_ID_KEY));

if (StringUtils.isNotEmpty(courseId)) {
replaceWithFragment(CourseFragment.newInstance(courseId), false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should uncheck any selected nav drawer entries if the app is being opened to a course. Maybe a setAllItemsUnchecked() method?

} else if (isUserLoggedIn) {
selectItem(Constants.NAV_DRAWER_PROFILE_INDEX, false);
} else {
selectItem(Constants.NAV_DRAWER_EXPLORE_INDEX, false);
Expand Down Expand Up @@ -198,6 +204,8 @@ public NdefMessage createNdefMessage(NfcEvent event) {
}, this);
}

// Register this device with GCM to receive push notifications, if possible.
RegistrationIdUtil.init(getApplicationContext());
}

/**
Expand Down Expand Up @@ -339,20 +347,28 @@ private void selectItem(int itemID, boolean addToBackStack) {
return;
}

replaceWithFragment(fragment, addToBackStack);
int selectedPosition = mNavDrawerAdapter.getPositionFromId(itemID);
if (selectedPosition >= 0) {
mDrawerList.setItemChecked(selectedPosition, true);
}
mDrawerLayout.closeDrawer(mDrawerContainer);
}

/**
* Adds the given fragment to the back stack and replaces the current one with it.
*/
private void replaceWithFragment(Fragment fragment, boolean addToBackStack) {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction()
.replace(R.id.content_frame, fragment);
if (addToBackStack) {
transaction.addToBackStack(null);
}
transaction.commit();
int selectedPosition = mNavDrawerAdapter.getPositionFromId(itemID);
if (selectedPosition >= 0) {
mDrawerList.setItemChecked(selectedPosition, true);
}
mDrawerLayout.closeDrawer(mDrawerContainer);
}


private void handleNfcIntent(Intent intent) {
if (intent == null) return;

Expand Down
Loading