-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented the majority of the mobile mockups provided in Issue #4
- Loading branch information
Showing
47 changed files
with
463 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
package ca.ubc.ubyssey; | ||
|
||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Calendar; | ||
import java.util.Date; | ||
import java.util.TimeZone; | ||
|
||
/** | ||
* Utility class for managing dates | ||
* | ||
* Created by Chris Li on 3/31/2015. | ||
*/ | ||
public class DateUtils { | ||
|
||
public static Date getFormattedDate(String date) { | ||
|
||
TimeZone timezone = TimeZone.getTimeZone("America/Los_Angeles"); | ||
Calendar cal = Calendar.getInstance(timezone); | ||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); | ||
sdf.setCalendar(cal); | ||
try { | ||
cal.setTime(sdf.parse(date)); | ||
} catch (ParseException e) { | ||
e.printStackTrace(); | ||
} | ||
Date formattedDate = cal.getTime(); | ||
|
||
return formattedDate; | ||
} | ||
|
||
public static String dayToString(Date date) { | ||
Calendar cal = Calendar.getInstance(); | ||
cal.setTime(date); | ||
int dayOf = cal.get(Calendar.DAY_OF_WEEK); | ||
int weekOf = cal.get(Calendar.WEEK_OF_MONTH); | ||
SimpleDateFormat time = new SimpleDateFormat("h:mm a"); | ||
String currentTime = time.format(cal.getTime()); | ||
Calendar curr = Calendar.getInstance(); | ||
int currDay = curr.get(Calendar.DAY_OF_WEEK); | ||
int currWeek = curr.get(Calendar.WEEK_OF_MONTH); | ||
if (weekOf == currWeek) { | ||
if (dayOf == currDay) { | ||
return "Today" + " " + currentTime; | ||
} else if (dayOf == Calendar.SUNDAY) { | ||
return "Sunday" + " " + currentTime; | ||
} else if (dayOf == Calendar.MONDAY) { | ||
return "Monday" + " " + currentTime; | ||
} else if (dayOf == Calendar.TUESDAY) { | ||
return "Tuesday" + " " + currentTime; | ||
} else if (dayOf == Calendar.WEDNESDAY) { | ||
return "Wednesday" + " " + currentTime; | ||
} else if (dayOf == Calendar.THURSDAY) { | ||
return "Thursday" + " " + currentTime; | ||
} else if (dayOf == Calendar.FRIDAY) { | ||
return "Friday" + " " + currentTime; | ||
} else { | ||
return "Saturday" + " " + currentTime; | ||
} | ||
} else { | ||
int month = cal.get(Calendar.MONTH); | ||
int day = cal.get(Calendar.DAY_OF_MONTH); | ||
int year = cal.get(Calendar.YEAR); | ||
return getMonth(month) + " " + day + ", " + year; | ||
} | ||
} | ||
|
||
public static String getMonth(int month){ | ||
String monthString = ""; | ||
switch(month){ | ||
case 0: | ||
monthString = "January"; | ||
break; | ||
case 1: | ||
monthString = "February"; | ||
break; | ||
case 2: | ||
monthString = "March"; | ||
break; | ||
case 3: | ||
monthString = "April"; | ||
break; | ||
case 4: | ||
monthString = "May"; | ||
break; | ||
case 5: | ||
monthString = "June"; | ||
break; | ||
case 6: | ||
monthString = "July"; | ||
break; | ||
case 7: | ||
monthString = "August"; | ||
break; | ||
case 8: | ||
monthString = "September"; | ||
break; | ||
case 9: | ||
monthString = "October"; | ||
break; | ||
case 10: | ||
monthString = "November"; | ||
break; | ||
case 11: | ||
monthString = "December"; | ||
break; | ||
} | ||
|
||
return monthString; | ||
} | ||
|
||
public static String getProperDateString(String date){ | ||
return dayToString(getFormattedDate(date)); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package ca.ubc.ubyssey; | ||
|
||
import android.app.Application; | ||
|
||
import org.acra.ACRA; | ||
import org.acra.annotation.ReportsCrashes; | ||
|
||
/** | ||
* Application class, where long-running tasks should be instantiated | ||
* | ||
* Created by Chris Li on 3/20/2015. | ||
*/ | ||
@ReportsCrashes(formKey = "", // will not be used | ||
mailTo = "[email protected]") | ||
public class MainApplication extends Application{ | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
//TODO: Remove ACRA library as soon the application becomes public | ||
ACRA.init(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.