Skip to content

Commit

Permalink
Android 1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jburns20 committed Sep 15, 2013
1 parent 56e306b commit 750fdc0
Show file tree
Hide file tree
Showing 56 changed files with 101 additions and 91 deletions.
Binary file added iHW-Android.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions iHW-Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher_2"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
Expand Down
4 changes: 2 additions & 2 deletions iHW-Android/bin/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
android:targetSdkVersion="18" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher_2"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
Expand Down
Binary file modified iHW-Android/bin/classes.dex
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/DayFragment$1.class
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/DayFragment$2$1.class
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/DayFragment$2.class
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/DayFragment.class
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 modified iHW-Android/bin/classes/com/ihwapp/android/PeriodView$1.class
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/PeriodView$2$1.class
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/PeriodView$2.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/PeriodView.class
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 modified iHW-Android/bin/classes/com/ihwapp/android/ScheduleActivity.class
Binary file not shown.
Binary file modified iHW-Android/bin/classes/com/ihwapp/android/model/Course.class
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 modified iHW-Android/bin/iHW-Android.apk
Binary file not shown.
Binary file modified iHW-Android/bin/resources.ap_
Binary file not shown.
6 changes: 3 additions & 3 deletions iHW-Android/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<string name="app_name">iHW Beta</string>
<string name="app_name">iHW</string>
<string name="hello_world">Hello world!</string>
<string name="prompt_welcome">Welcome to iHW for Android! (Beta)</string>
<string name="prompt_welcome">Welcome to iHW for Android!</string>
<string name="title_activity_schedule">View Schedule</string>
<string name="title_activity_edit_courses">Edit Courses</string>
<string name="button_download">Download from HW.com</string>
Expand Down Expand Up @@ -57,6 +57,6 @@
<string name="button_campus_upper">Upper</string>
<string name="button_redownload">Redownload schedule from HW.com</string>
<string name="prompt_courses_deleted">(All current courses will be deleted)</string>
<string name="disclaimer">DISCLAIMER\nThis application is provided for students of Harvard-Westlake School as a service. This service may be suspended or terminated at any time. Any data stored in the application is not guaranteed to be perpetually available. In no event shall either the developer of this application or Harvard-Westlake School be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including tardiness caused by incorrect information provided in this application).\nThe developer of this application, a student at Harvard-Westlake School, is not an official representative of the school. This application and the information provided herein are pending approval by Harvard-Westlake School.</string>
<string name="disclaimer">DISCLAIMER\nThis application is provided for students of Harvard-Westlake School as a service. This service may be suspended or terminated at any time. Any data stored in the application is not guaranteed to be perpetually available. In no event shall either the developer of this application or Harvard-Westlake School be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including tardiness caused by incorrect information provided in this application).\nThe developer of this application, a student at Harvard-Westlake School, is not an official representative of the school. This application and the information provided herein are approved by Harvard-Westlake School.</string>
<string name="action_refresh">Refresh</string>
</resources>
27 changes: 13 additions & 14 deletions iHW-Android/src/com/ihwapp/android/DayFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.app.Activity;
import android.graphics.Typeface;
import android.os.Bundle;
import android.util.Log;
import android.view.*;
import android.widget.*;

Expand All @@ -30,7 +29,7 @@ public void setArguments(Bundle b) {

public void onAttach(Activity activity) {
super.onAttach(activity);
Log.d("iHW-lc", "DayFragment onAttach");
//Log.d("iHW-lc", "DayFragment onAttach");
}

public void onCreate(Bundle savedInstanceState) {
Expand All @@ -43,16 +42,16 @@ public void onCreate(Bundle savedInstanceState) {
initScrollPos = savedInstanceState.getInt("scrollPos");
}
day = Curriculum.getCurrentCurriculum().getDay(date);
Log.d("iHW-lc", "DayFragment onCreate: " + date);
//Log.d("iHW-lc", "DayFragment onCreate: " + date);
}

public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Log.d("iHW-lc", "DayFragment onCreateView: " + date);
//Log.d("iHW-lc", "DayFragment onCreateView: " + date);
final View v = inflater.inflate(R.layout.fragment_day, null);
if (!Curriculum.getCurrentCurriculum().isLoaded()) return v;
assert v != null;
TextView titleText = ((TextView)v.findViewById(R.id.date_view));
Log.d("iHW", "Day: " + day);
//Log.d("iHW", "Day: " + day);
titleText.setText(day.getTitle());
titleText.setTypeface(Typeface.SERIF, Typeface.BOLD);

Expand Down Expand Up @@ -95,12 +94,12 @@ public View onCreateView(final LayoutInflater inflater, ViewGroup container, Bun

public void onStart() {
super.onStart();
Log.d("iHW-lc", "DayFragment onStart: " + date);
//Log.d("iHW-lc", "DayFragment onStart: " + date);
}

public void onResume() {
super.onResume();
Log.d("iHW-lc", "DayFragment onResume: " + date);
//Log.d("iHW-lc", "DayFragment onResume: " + date);
final ScrollView sv = (ScrollView)getView().findViewById(R.id.scroll_periods);
sv.setFocusableInTouchMode(true);
sv.post(new Runnable() {
Expand Down Expand Up @@ -128,23 +127,23 @@ public void run() {

public void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
Log.d("iHW-lc", "DayFragment onSaveInstanceState: " + date);
//Log.d("iHW-lc", "DayFragment onSaveInstanceState: " + date);
//outState.putString("dayJSON", day.saveDay().toString());
outState.putString("date", date.toString());
outState.putInt("scrollPos", getView().findViewById(R.id.scroll_periods).getScrollY());
}

public void onPause() {
super.onPause();
Log.d("iHW-lc", "DayFragment (" + this + ") onPause: " + date);
//Log.d("iHW-lc", "DayFragment (" + this + ") onPause: " + date);
initScrollPos = getView().findViewById(R.id.scroll_periods).getScrollY();
countdownTimer.cancel();
countdownTimer = null;
}

public void onStop() {
super.onStop();
Log.d("iHW-lc", "DayFragment onStop: " + date);
//Log.d("iHW-lc", "DayFragment onStop: " + date);
//if (countdownTimer != null) countdownTimer.cancel();
//if (countdownView != null) countdownView.setVisibility(View.GONE);
if (this.getUserVisibleHint() && ofvcls != null) {
Expand All @@ -155,7 +154,7 @@ public void onStop() {
}

public void onDestroyView() {
Log.d("iHW-lc", "DayFragment onDestroyView: " + date);
//Log.d("iHW-lc", "DayFragment onDestroyView: " + date);
super.onDestroyView();
periodViews.clear();
periodViews = null;
Expand All @@ -165,12 +164,12 @@ public void onDestroyView() {
}

public void onDestroy() {
Log.d("iHW-lc", "DayFragment onDestroy: " + date);
//Log.d("iHW-lc", "DayFragment onDestroy: " + date);
super.onDestroy();
}

public void onDetach() {
Log.d("iHW-lc", "DayFragment " + this + " onDetach from " + this.getActivity() + ": " + date);
//Log.d("iHW-lc", "DayFragment " + this + " onDetach from " + this.getActivity() + ": " + date);
super.onDetach();
if (date==null) return;
this.ofvcls.clear();
Expand Down Expand Up @@ -226,7 +225,7 @@ public void run() {
}*/

public void setUserVisibleHint(boolean isVisibleToUser) {
Log.d("iHW-lc", "DayFragment setUserVisibleHint: " + isVisibleToUser + "(" + date + ")");
//Log.d("iHW-lc", "DayFragment setUserVisibleHint: " + isVisibleToUser + "(" + date + ")");
if (this.getUserVisibleHint() != isVisibleToUser && (this.isVisible() || isVisibleToUser) && ofvcls != null) {
for (OnFragmentVisibilityChangedListener l : ofvcls) {
l.onFragmentVisibilityChanged(this, isVisibleToUser);
Expand Down
17 changes: 8 additions & 9 deletions iHW-Android/src/com/ihwapp/android/DownloadScheduleActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.util.Log;
import android.view.*;
import android.widget.*;
import android.webkit.*;
Expand Down Expand Up @@ -75,7 +74,7 @@ public void onClick(DialogInterface dialog, int which) {
}

public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
Log.e("iHW", errorCode + ": " + description);
//Log.e("iHW", errorCode + ": " + description);
showScheduleUnavailableError();
}
});
Expand Down Expand Up @@ -116,12 +115,12 @@ protected void onPreExecute() {
changeInfoText("Schedule found. Downloading...");
}
protected Document doInBackground(String...url) {
Log.d("iHW", "Downloading/parsing HTML");
//Log.d("iHW", "Downloading/parsing HTML");
Document doc = null;
try {
doc = Jsoup.connect(url[0]).get();
} catch (Exception e) {
Log.e("iHW", e.getClass().getName() + " Downloading/parsing HTML");
//Log.e("iHW", e.getClass().getName() + " Downloading/parsing HTML");
e.printStackTrace();
}
return doc;
Expand All @@ -141,19 +140,19 @@ protected void onPostExecute(Document result) {

for (Element div : divs) {
if (div.attr("id").equals("nameStudentName1-0")) {
Log.d("iHW", "Name: " + div.getElementsByTag("span").first().text());
//Log.d("iHW", "Name: " + div.getElementsByTag("span").first().text());
} else if (div.attr("id").equals("sectCode1")) {
lastCode = div.getElementsByTag("span").first().text();
if (lastCode.length() <= 4) shouldShowWarning = true;
Log.d("iHW", "Course code: " + lastCode);
//Log.d("iHW", "Course code: " + lastCode);
} else if (div.attr("id").equals("sectTitle1")) {
lastName = div.getElementsByTag("span").first().text();
Log.d("iHW", "Course name: " + lastName);
//Log.d("iHW", "Course name: " + lastName);
} else if (div.attr("id").equals("sectPeriodList1")) {
lastPeriodList = div.getElementsByTag("span").first().text();
Log.d("iHW", "Course meets: " + lastPeriodList);
//Log.d("iHW", "Course meets: " + lastPeriodList);
String[] tokens = lastPeriodList.split("\\.");
Log.d("iHW", "Number of tokens: " + tokens.length);
//Log.d("iHW", "Number of tokens: " + tokens.length);
if (tokens.length != Curriculum.getCurrentCampus()) {
new AlertDialog.Builder(DownloadScheduleActivity.this, R.style.PopupTheme).setTitle("Wrong Campus!")
.setMessage("You chose the wrong campus during the setup. Please start again.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void onBackPressed() {
.setNegativeButton("Go Back", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Curriculum.getCurrentCurriculum().removeAllCourses();
Curriculum.save();
Curriculum.getCurrentCurriculum().saveCourses();
GuidedCoursesActivity.this.finish();
}
}).setPositiveButton("Keep Editing", null).show();
Expand Down
5 changes: 3 additions & 2 deletions iHW-Android/src/com/ihwapp/android/PeriodView.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
import android.os.Parcelable;
import android.support.v4.app.Fragment;
import android.text.*;
import android.util.*;
import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.*;
import android.view.inputmethod.EditorInfo;
import android.widget.*;
Expand Down Expand Up @@ -155,7 +156,7 @@ private void makeUnimportant(int index) {

private void saveNotes() {
if (changesSaved) return;
Log.d("iHW", "Saving notes for period at: " + this.period.getDate() + ":" + this.period.getIndex());
//Log.d("iHW", "Saving notes for period at: " + this.period.getDate() + ":" + this.period.getIndex());
ArrayList<Note> notes = new ArrayList<Note>(notesLayout.getChildCount());
for (int i=0; i<notesLayout.getChildCount(); i++) {
View v = notesLayout.getChildAt(i);
Expand Down
19 changes: 9 additions & 10 deletions iHW-Android/src/com/ihwapp/android/ScheduleActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.content.*;
import android.support.v4.app.*;
import android.support.v4.view.*;
import android.util.Log;
import android.view.*;
import android.view.ViewGroup.LayoutParams;
import android.widget.*;
Expand All @@ -28,7 +27,7 @@ public class ScheduleActivity extends FragmentActivity implements Curriculum.Mod
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
Log.d("iHW-lc", "ScheduleActivity onCreate");
//Log.d("iHW-lc", "ScheduleActivity onCreate");
Curriculum.ctx = this.getApplicationContext();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_schedule);
Expand Down Expand Up @@ -64,10 +63,10 @@ public void onPageScrollStateChanged(int arg0) { }

protected void onStart() {
super.onStart();
Log.d("iHW-lc", "ScheduleActivity onStart: first loaded date " + Curriculum.getCurrentCurriculum().getFirstLoadedDate());
//Log.d("iHW-lc", "ScheduleActivity onStart: first loaded date " + Curriculum.getCurrentCurriculum().getFirstLoadedDate());
//Typeface georgia = Typeface.createFromAsset(getAssets(), "fonts/Georgia.ttf");
if (Curriculum.getCurrentCurriculum().isLoaded()) {
Log.d("iHW", "Setting adapter");
//Log.d("iHW", "Setting adapter");
if (adapter == null) adapter = new DayPagerAdapter(this.getSupportFragmentManager());
pager.setAdapter(adapter);
if (lastIndex >= 0) pager.setCurrentItem(lastIndex, false);
Expand All @@ -89,7 +88,7 @@ public void onProgressUpdate(int progress) {

@Override
public void onFinishedLoading(Curriculum c) {
Log.d("iHW-lc", "ScheduleActivity onFinishedLoading");
//Log.d("iHW-lc", "ScheduleActivity onFinishedLoading");
if (adapter == null) adapter = new DayPagerAdapter(this.getSupportFragmentManager());
pager.setAdapter(adapter);
adapter.notifyDataSetChanged();
Expand Down Expand Up @@ -169,23 +168,23 @@ public void onClick(DialogInterface dialog, int which) {
public void onSaveInstanceState(Bundle outState) {
this.pager.setAdapter(null);
super.onSaveInstanceState(outState);
Log.d("iHW-lc", "ScheduleActivity onSaveInstanceState");
//Log.d("iHW-lc", "ScheduleActivity onSaveInstanceState");
outState.putInt("lastIndex", lastIndex);
}

public void onPause() {
super.onPause();
Log.d("iHW-lc", "ScheduleActivity onPause");
//Log.d("iHW-lc", "ScheduleActivity onPause");
}

public void onStop() {
Log.d("iHW-lc", "ScheduleActivity onStop");
//Log.d("iHW-lc", "ScheduleActivity onStop");
pager.setAdapter(null);
super.onStop();
}

public void onDestroy() {
Log.d("iHW-lc", "ScheduleActivity onDestroy");
//Log.d("iHW-lc", "ScheduleActivity onDestroy");
super.onDestroy();
}

Expand Down Expand Up @@ -214,7 +213,7 @@ public Fragment getItem(int position) {
Date date = new Date(7,1,Curriculum.getCurrentYear()).dateByAdding(position);
DayFragment f = new DayFragment();
Bundle b = new Bundle();
Log.d("iHW", "pager: " + pager + " asked for " + date.toString());
//Log.d("iHW", "pager: " + pager + " asked for " + date.toString());
b.putString("date", date.toString());
f.setArguments(b);
return f;
Expand Down
1 change: 0 additions & 1 deletion iHW-Android/src/com/ihwapp/android/model/Course.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.json.*;

@SuppressWarnings("ALL")
public class Course {
private String name;
private int period;
Expand Down
Loading

0 comments on commit 750fdc0

Please sign in to comment.