diff --git a/iHW-Android.apk b/iHW-Android.apk
new file mode 100644
index 0000000..6f27966
Binary files /dev/null and b/iHW-Android.apk differ
diff --git a/iHW-Android/AndroidManifest.xml b/iHW-Android/AndroidManifest.xml
index 774c496..0fa19f4 100644
--- a/iHW-Android/AndroidManifest.xml
+++ b/iHW-Android/AndroidManifest.xml
@@ -6,14 +6,14 @@
+ android:targetSdkVersion="18" />
+ android:targetSdkVersion="18" />
- iHW Beta
+ iHW
Hello world!
- Welcome to iHW for Android! (Beta)
+ Welcome to iHW for Android!
View Schedule
Edit Courses
Download from HW.com
@@ -57,6 +57,6 @@
Upper
Redownload schedule from HW.com
(All current courses will be deleted)
- 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.
+ 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.
Refresh
\ No newline at end of file
diff --git a/iHW-Android/src/com/ihwapp/android/DayFragment.java b/iHW-Android/src/com/ihwapp/android/DayFragment.java
index 9e176f5..3ab0e84 100644
--- a/iHW-Android/src/com/ihwapp/android/DayFragment.java
+++ b/iHW-Android/src/com/ihwapp/android/DayFragment.java
@@ -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.*;
@@ -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) {
@@ -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);
@@ -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() {
@@ -128,7 +127,7 @@ 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());
@@ -136,7 +135,7 @@ public void onSaveInstanceState(Bundle outState) {
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;
@@ -144,7 +143,7 @@ public void onPause() {
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) {
@@ -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;
@@ -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();
@@ -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);
diff --git a/iHW-Android/src/com/ihwapp/android/DownloadScheduleActivity.java b/iHW-Android/src/com/ihwapp/android/DownloadScheduleActivity.java
index 27af1b7..5c6d0dd 100644
--- a/iHW-Android/src/com/ihwapp/android/DownloadScheduleActivity.java
+++ b/iHW-Android/src/com/ihwapp/android/DownloadScheduleActivity.java
@@ -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.*;
@@ -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();
}
});
@@ -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;
@@ -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.")
diff --git a/iHW-Android/src/com/ihwapp/android/GuidedCoursesActivity.java b/iHW-Android/src/com/ihwapp/android/GuidedCoursesActivity.java
index 15fbec3..8eaf9e4 100644
--- a/iHW-Android/src/com/ihwapp/android/GuidedCoursesActivity.java
+++ b/iHW-Android/src/com/ihwapp/android/GuidedCoursesActivity.java
@@ -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();
diff --git a/iHW-Android/src/com/ihwapp/android/PeriodView.java b/iHW-Android/src/com/ihwapp/android/PeriodView.java
index 0c23cfa..5aff068 100644
--- a/iHW-Android/src/com/ihwapp/android/PeriodView.java
+++ b/iHW-Android/src/com/ihwapp/android/PeriodView.java
@@ -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.*;
@@ -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 notes = new ArrayList(notesLayout.getChildCount());
for (int i=0; i= 0) pager.setCurrentItem(lastIndex, false);
@@ -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();
@@ -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();
}
@@ -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;
diff --git a/iHW-Android/src/com/ihwapp/android/model/Course.java b/iHW-Android/src/com/ihwapp/android/model/Course.java
index 2e409f3..ac8f4dd 100644
--- a/iHW-Android/src/com/ihwapp/android/model/Course.java
+++ b/iHW-Android/src/com/ihwapp/android/model/Course.java
@@ -2,7 +2,6 @@
import org.json.*;
-@SuppressWarnings("ALL")
public class Course {
private String name;
private int period;
diff --git a/iHW-Android/src/com/ihwapp/android/model/Curriculum.java b/iHW-Android/src/com/ihwapp/android/model/Curriculum.java
index 8e95890..f2052a7 100644
--- a/iHW-Android/src/com/ihwapp/android/model/Curriculum.java
+++ b/iHW-Android/src/com/ihwapp/android/model/Curriculum.java
@@ -19,7 +19,6 @@
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.AsyncTask;
-import android.util.Log;
public class Curriculum {
private static Curriculum currentCurriculum;
@@ -40,10 +39,10 @@ public static Curriculum reloadCurrentCurriculum() {
*/
private static Curriculum getCurriculum(int campus, int year) {
if (currentCurriculum == null || currentCurriculum.getCampus() != campus || currentCurriculum.getYear() != year) {
- Log.d("iHW", "Recreating curriculum object");
+ //Log.d("iHW", "Recreating curriculum object");
currentCurriculum = new Curriculum(campus, year, new Date());
}
- Log.d("iHW", "Returning existing curriculum object");
+ //Log.d("iHW", "Returning existing curriculum object");
return currentCurriculum;
}
@@ -136,10 +135,6 @@ private static boolean termsCompatible(int a, int b) {
return true;
}
- public static void save() {
- Log.e("iHW", "SAVE static method was called -- this is not correct!");
- }
-
/********************************END STATIC STUFF***********************************/
/*******************************BEGIN INSTANCE STUFF********************************/
@@ -183,7 +178,7 @@ private Curriculum(int campus, int year, Date startingDate) {
private void loadEverything(final Date startingDate) {
if (loadingProgress >= 0) {
- Log.d("iHW", "Tried to load everything but loading has already started.");
+ //Log.d("iHW", "Tried to load everything but loading has already started.");
return;
}
String campusChar = getCampusChar(this.campus);
@@ -192,13 +187,16 @@ private void loadEverything(final Date startingDate) {
final AsyncTask phase2 = new AsyncTask() {
protected Void doInBackground(Void... params) {
- Log.d("iHW", "starting phase 2");
+ //Log.d("iHW", "starting phase 2");
boolean success = loadThisWeekAndDay(startingDate);
- if (!success) { Log.e("iHW", "ERROR loading first week and day"); return null; }
+ if (!success) {
+ //Log.e("iHW", "ERROR loading first week and day");
+ return null;
+ }
this.publishProgress(4);
cacheNeededWeeksDays(startingDate);
this.publishProgress(5);
- Log.d("iHW", "finished phase 2");
+ //Log.d("iHW", "finished phase 2");
return null;
}
@@ -215,22 +213,22 @@ protected void onProgressUpdate(Integer... values) {
protected Void doInBackground(Void... params) {
this.publishProgress(0);
- Log.d("iHW", "starting phase 1a");
+ //Log.d("iHW", "starting phase 1a");
boolean success = downloadParseScheduleJSON(scheduleJSON.equals(""));
if (!success) {
- Log.e("iHW", "FATAL ERROR downloading schedule JSON");
+ //Log.e("iHW", "FATAL ERROR downloading schedule JSON");
this.publishProgress(-1);
return null;
}
this.publishProgress(1);
success = loadDayNumbers();
if (!success) {
- Log.e("iHW", "ERROR loading day numbers");
+ //Log.e("iHW", "ERROR loading day numbers");
this.publishProgress(-1);
return null;
}
this.publishProgress(2);
- Log.d("iHW", "finished phase 1a");
+ //Log.d("iHW", "finished phase 1a");
return null;
}
@@ -252,11 +250,14 @@ protected void onProgressUpdate(Integer... values) {
final AsyncTask phase1b = new AsyncTask() {
protected Void doInBackground(Void... params) {
- Log.d("iHW", "starting phase 1b");
+ //Log.d("iHW", "starting phase 1b");
boolean success = loadCourses();
- if (!success) { Log.e("iHW", "ERROR loading courses"); return null; }
+ if (!success) {
+ //Log.e("iHW", "ERROR loading courses");
+ return null;
+ }
this.publishProgress(3);
- Log.d("iHW", "finished phase 1b");
+ //Log.d("iHW", "finished phase 1b");
return null;
}
@@ -294,7 +295,7 @@ public boolean isLoaded() {
}
private boolean downloadParseScheduleJSON(boolean important) {
- Log.d("iHW", "Starting schedule JSON download (if able)");
+ //Log.d("iHW", "Starting schedule JSON download (if able)");
ConnectivityManager connMgr = (ConnectivityManager)ctx.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo networkInfo = connMgr.getActiveNetworkInfo();
if (networkInfo == null || !networkInfo.isConnected()) { //no Internet connection
@@ -304,12 +305,12 @@ private boolean downloadParseScheduleJSON(boolean important) {
} else { //Internet is available; should update
DownloadTask downloadTask = new DownloadTask();
if (important) {
- Log.d("iHW", "downloading on MAIN THREAD");
+ //Log.d("iHW", "downloading on MAIN THREAD");
String result = downloadTask.doInBackground();
downloadTask.onPostExecute(result);
return (!result.equals(""));
} else {
- Log.d("iHW", "downloading in BACKGROUND");
+ //Log.d("iHW", "downloading in BACKGROUND");
parseScheduleJSON();
downloadTask.execute();
return true;
@@ -319,11 +320,11 @@ private boolean downloadParseScheduleJSON(boolean important) {
private class DownloadTask extends AsyncTask {
public String doInBackground(Void... params) {
- Log.d("iHW", "internet is available - will download schedule JSON");
+ //Log.d("iHW", "internet is available - will download schedule JSON");
HttpURLConnection urlConnection = null;
String result = null;
String campusChar = getCampusChar(campus);
- String urlStr = "http://www.burnsfamily.info/curriculum" + year + campusChar + ".hws";
+ String urlStr = "http://www.ihwapp.com/curriculum/" + year + campusChar + ".hws";
try {
URL url = new URL(urlStr);
urlConnection = (HttpURLConnection) url.openConnection();
@@ -348,18 +349,18 @@ public String doInBackground(Void... params) {
public void onPostExecute(String result) {
if (result != null && !result.equals("")) {
String campusChar = getCampusChar(campus);
- Log.d("iHW", "downloaded schedule JSON successfully");
+ //Log.d("iHW", "downloaded schedule JSON successfully");
SharedPreferences prefs = ctx.getSharedPreferences(year + campusChar, Context.MODE_PRIVATE);
prefs.edit().putString("scheduleJSON", result).commit();
boolean success = parseScheduleJSON();
- if (!success) Log.e("iHW", "ERROR parsing schedule JSON");
+ //if (!success) Log.e("iHW", "ERROR parsing schedule JSON");
}
}
}
private boolean parseScheduleJSON() {
try {
- Log.d("iHW", "Starting to parse schedule JSON");
+ //Log.d("iHW", "Starting to parse schedule JSON");
String campusChar = getCampusChar(this.campus);
SharedPreferences prefs = ctx.getSharedPreferences(year + campusChar, Context.MODE_PRIVATE);
String scheduleJSON = prefs.getString("scheduleJSON", "");
@@ -393,14 +394,14 @@ private boolean parseScheduleJSON() {
sdts.put(d, specialDaysObj.getJSONObject(key));
}
specialDayTemplates = sdts;
- Log.d("iHW", "finished parsing schedule JSON");
+ //Log.d("iHW", "finished parsing schedule JSON");
return true;
} catch (JSONException ignored) {}
return false;
}
private boolean loadCourses() {
- Log.d("iHW", "starting to load courses");
+ //Log.d("iHW", "starting to load courses");
HashSet coursesSet;
try {
String campusChar = getCampusChar(campus);
@@ -415,14 +416,14 @@ private boolean loadCourses() {
coursesSet.add(new Course(coursesArr.getJSONObject(i)));
}
courses = coursesSet;
- Log.d("iHW", "finished loading courses");
+ //Log.d("iHW", "finished loading courses");
return true;
} catch (JSONException ignored) { }
return false;
}
private boolean loadDayNumbers() {
- Log.d("iHW", "starting to load day numbers");
+ //Log.d("iHW", "starting to load day numbers");
if (specialDayTemplates == null || semesterEndDates == null) return false;
SortedMap dayNums;
try {
@@ -451,7 +452,7 @@ private boolean loadDayNumbers() {
d=d.dateByAdding(1);
}
dayNumbers = dayNums;
- Log.d("iHW", "finished loading day numbers");
+ //Log.d("iHW", "finished loading day numbers");
return true;
} catch (JSONException ignored) {}
return false;
@@ -459,9 +460,15 @@ private boolean loadDayNumbers() {
private boolean loadThisWeekAndDay(Date date) {
boolean success = loadWeek(date);
- if (!success) { Log.e("iHW", "ERROR loading week"); return false; }
+ if (!success) {
+ //Log.e("iHW", "ERROR loading week");
+ return false;
+ }
success = loadDay(date);
- if (!success) { Log.e("iHW", "ERROR loading day"); return false; }
+ if (!success) {
+ //Log.e("iHW", "ERROR loading day");
+ return false;
+ }
return true;
}
@@ -470,7 +477,7 @@ private void cacheNeededWeeksDays(final Date currentDate) {
currentlyCaching = true;
new AsyncTask() {
protected Void doInBackground(Void... params) {
- Log.d("iHW", "starting to cache needed weeks and days");
+ //Log.d("iHW", "starting to cache needed weeks and days");
Date currentWeekStart = getWeekStart(year, currentDate);
ArrayList weeksNeeded = new ArrayList(3);
for (int i=-7; i<=7; i+=7) weeksNeeded.add(currentWeekStart.dateByAdding(i));
@@ -484,7 +491,7 @@ protected Void doInBackground(Void... params) {
for (Date d : daysNeeded) if (isInBounds(d) && !loadedDays.containsKey(d)) {
loadDay(d);
}
- Log.d("iHW", "finished caching weeks and days");
+ //Log.d("iHW", "finished caching weeks and days");
currentlyCaching = false;
return null;
}
@@ -493,7 +500,7 @@ protected Void doInBackground(Void... params) {
private boolean loadWeek(Date date) {
try {
- Log.d("iHW", "starting to load week containing " + date);
+ //Log.d("iHW", "starting to load week containing " + date);
int weekNumber = getWeekNumber(year, date);
Date weekStart = getWeekStart(year, date);
if (loadedWeeks != null && loadedWeeks.containsKey(new Date(weekStart.toString()))) return true;
@@ -507,7 +514,7 @@ private boolean loadWeek(Date date) {
weekJSONObj = new JSONObject(weekJSON);
if (loadedWeeks == null) loadedWeeks = Collections.synchronizedSortedMap(new TreeMap());
loadedWeeks.put(new Date(weekStart.toString()), weekJSONObj);
- Log.d("iHW", "finished loading week");
+ //Log.d("iHW", "finished loading week");
return true;
} catch (JSONException ignored) {}
return false;
@@ -516,7 +523,7 @@ private boolean loadWeek(Date date) {
private boolean loadDay(Date d) {
if (!isInBounds(d)) return false;
try {
- Log.d("iHW", "starting to load day: " + d);
+ //Log.d("iHW", "starting to load day: " + d);
//Date weekStart = getWeekStart(year, d);
if (loadedDays == null) loadedDays = Collections.synchronizedSortedMap(new TreeMap());
//if (!loadedWeeks.containsKey(weekStart)) return false;
@@ -552,22 +559,25 @@ private boolean loadDay(Date d) {
} else if (type.equals("test")) loadedDays.put(d, new TestDay(template));
else if (type.equals("holiday")) loadedDays.put(d, new Holiday(template));
else return false;
- Log.d("iHW", "finished loading day");
+ //Log.d("iHW", "finished loading day");
return true;
} catch (JSONException ignored) { }
return false;
}
public Day getDay(Date d) {
- if (!isInBounds(d)) { Log.d("iHW", "Date out of bounds: " + d); return null; }
- Log.d("iHW", "getting " + d.toString());
+ if (!isInBounds(d)) {
+ //Log.d("iHW", "Date out of bounds: " + d);
+ return null;
+ }
+ //Log.d("iHW", "getting " + d.toString());
//Log.d("iHW", "weeks loaded: " + loadedWeeks.keySet().toString());
if (!isLoaded(d)) {
boolean success = true;
if (loadedWeeks == null || !loadedWeeks.containsKey(getWeekStart(year, d))) success = loadWeek(d);
- if (!success) Log.e("iHW", "ERROR loading week");
+ //if (!success) Log.e("iHW", "ERROR loading week");
if (loadedDays == null || !loadedDays.containsKey(d)) success = loadDay(d);
- if (!success) Log.e("iHW", "ERROR loading day");
+ //if (!success) Log.e("iHW", "ERROR loading day");
}
if (!isLoaded(d)) return null;
else {
@@ -778,7 +788,10 @@ public ArrayList getNotes(Date d, int period) {
Date weekStart = getWeekStart(year, d);
boolean success = true;
if (!loadedWeeks.containsKey(weekStart)) success = loadWeek(d);
- if (!success) { Log.e("iHW", "ERROR loading week"); return null; }
+ if (!success) {
+ //Log.e("iHW", "ERROR loading week");
+ return null;
+ }
else {
try {
String key = d.toString() + "." + period;
@@ -795,7 +808,7 @@ public ArrayList getNotes(Date d, int period) {
return new ArrayList(6);
}
} catch (JSONException e) {
- Log.e("iHW", "JSONException!", e);
+ //Log.e("iHW", "JSONException!", e);
}
return null;
}
@@ -806,9 +819,9 @@ public void setNotes(Date d, int period, ArrayList notes) {
if (!isLoaded(d)) {
boolean success = true;
if (!loadedWeeks.containsKey(weekStart)) success = loadWeek(d);
- if (!success) Log.e("iHW", "ERROR loading week");
+ //if (!success) Log.e("iHW", "ERROR loading week");
if (!loadedDays.containsKey(d)) success = loadDay(d);
- if (!success) Log.e("iHW", "ERROR loading day");
+ //if (!success) Log.e("iHW", "ERROR loading day");
}
if (isLoaded(d)) {
try {
diff --git a/iHW-iOS/iHW/iHW.xcodeproj/project.xcworkspace/xcuserdata/jonathanburns.xcuserdatad/UserInterfaceState.xcuserstate b/iHW-iOS/iHW/iHW.xcodeproj/project.xcworkspace/xcuserdata/jonathanburns.xcuserdatad/UserInterfaceState.xcuserstate
index 79abacb..83953db 100644
Binary files a/iHW-iOS/iHW/iHW.xcodeproj/project.xcworkspace/xcuserdata/jonathanburns.xcuserdatad/UserInterfaceState.xcuserstate and b/iHW-iOS/iHW/iHW.xcodeproj/project.xcworkspace/xcuserdata/jonathanburns.xcuserdatad/UserInterfaceState.xcuserstate differ
diff --git a/icon_favicon.png b/icon_favicon.png
new file mode 100644
index 0000000..2e558f5
Binary files /dev/null and b/icon_favicon.png differ
diff --git a/images/icon_android_fullsize.png b/images/icon_android_fullsize.png
new file mode 100644
index 0000000..fd458a1
Binary files /dev/null and b/images/icon_android_fullsize.png differ
diff --git a/images/icon_android_playstore.png b/images/icon_android_playstore.png
new file mode 100644
index 0000000..1f6b411
Binary files /dev/null and b/images/icon_android_playstore.png differ
diff --git a/images/icon_android_website.png b/images/icon_android_website.png
new file mode 100644
index 0000000..d3ccd0b
Binary files /dev/null and b/images/icon_android_website.png differ
diff --git a/images/screenshots/Screenshot_2013-09-14-16-53-39.png b/images/screenshots/Screenshot_2013-09-14-16-53-39.png
new file mode 100644
index 0000000..ee0507b
Binary files /dev/null and b/images/screenshots/Screenshot_2013-09-14-16-53-39.png differ
diff --git a/images/screenshots/Screenshot_2013-09-14-16-54-39.png b/images/screenshots/Screenshot_2013-09-14-16-54-39.png
new file mode 100644
index 0000000..3ca18e9
Binary files /dev/null and b/images/screenshots/Screenshot_2013-09-14-16-54-39.png differ
diff --git a/images/screenshots/Screenshot_2013-09-14-16-54-48.png b/images/screenshots/Screenshot_2013-09-14-16-54-48.png
new file mode 100644
index 0000000..34b7e5e
Binary files /dev/null and b/images/screenshots/Screenshot_2013-09-14-16-54-48.png differ
diff --git a/images/screenshots/screenshot02.png b/images/screenshots/screenshot02.png
new file mode 100644
index 0000000..11e595d
Binary files /dev/null and b/images/screenshots/screenshot02.png differ