From b018c6a83a3464a84a64b0094d38f42d74d2ef74 Mon Sep 17 00:00:00 2001 From: ObjectiveTruth Date: Sat, 22 Oct 2016 11:41:56 -0400 Subject: [PATCH 1/3] Upgraded to new android plugin 2.2.2 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 41baa2f..fab7a10 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -14,7 +14,7 @@ buildscript { } dependencies { // Main Android gradle plugin allows building of the entire play toolchain - classpath 'com.android.tools.build:gradle:2.2.0-beta3' + classpath 'com.android.tools.build:gradle:2.2.2' // Fabric repository for Crashlytics. classpath 'io.fabric.tools:gradle:1.+' // Adds tasks to auto publish apks to Google App Store. https://github.com/Triple-T/gradle-play-publisher From 75ac2c6fe9dc2b35a4ff84002831a584496e82a0 Mon Sep 17 00:00:00 2001 From: ObjectiveTruth Date: Sat, 22 Oct 2016 11:57:44 -0400 Subject: [PATCH 2/3] Temporary fix for day of week issue Keeps switching based on Locale.. best solution is to use JODA time but too much effort for little payoff. If it can't be calculated, it will be left as blank --- app/src/main/assets/whatsnew_minor.txt | 7 +++++++ app/src/main/assets/whatsnew_thisversion.txt | 7 ++----- .../calendar/common/CalendarPagerAdapter.java | 3 +++ 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/src/main/assets/whatsnew_minor.txt b/app/src/main/assets/whatsnew_minor.txt index 2454612..3a1953b 100644 --- a/app/src/main/assets/whatsnew_minor.txt +++ b/app/src/main/assets/whatsnew_minor.txt @@ -1,3 +1,10 @@ +September 2, 2016 +=== +‣ Booking from the calendar works +‣ Joining from the calendar works +‣ Leaving from the calendar works +‣ If you're not logged in, it will ask you to + August 14, 2016 === ‣ Scrolling downwards on the grid no longer randomly triggers pull to refresh diff --git a/app/src/main/assets/whatsnew_thisversion.txt b/app/src/main/assets/whatsnew_thisversion.txt index 00b266e..e112395 100644 --- a/app/src/main/assets/whatsnew_thisversion.txt +++ b/app/src/main/assets/whatsnew_thisversion.txt @@ -1,6 +1,3 @@ -September 2, 2016 +October 22, 2016 === -‣ Booking from the calendar works -‣ Joining from the calendar works -‣ Leaving from the calendar works -‣ If you're not logged in, it will ask you to +‣ Fixed issue with date not being available which crashed the app diff --git a/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/calendar/common/CalendarPagerAdapter.java b/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/calendar/common/CalendarPagerAdapter.java index 84ce9cd..90d7813 100644 --- a/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/calendar/common/CalendarPagerAdapter.java +++ b/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/calendar/common/CalendarPagerAdapter.java @@ -129,6 +129,9 @@ private String _getDayOfWeekFromCalendarDataAtPosition(CalendarData calendarData } catch (ParseException e) { Timber.e(e, "Couldn't parse the string for the date. Got: " + parseMe); return ""; + } catch (ArrayIndexOutOfBoundsException e) { + Timber.w(e, "Day of week was not in the expected range"); + return ""; } } From 1341fde5a7840e75d1eb8aa42b12e5a6cf7bfa07 Mon Sep 17 00:00:00 2001 From: ObjectiveTruth Date: Sun, 27 Nov 2016 21:44:17 -0500 Subject: [PATCH 3/3] Fixed an issue with the parse no loading the date properly Also, the MyAccount Fragment wasn't working properly --- .../data/models/usermodel/MyAccountParser.java | 5 ++--- .../userinterface/calendar/grid/common/GridAdapter.java | 4 ++-- .../myaccount/myaccountloaded/BookingsAdapter.java | 8 +++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/objectivetruth/uoitlibrarybooking/data/models/usermodel/MyAccountParser.java b/app/src/main/java/com/objectivetruth/uoitlibrarybooking/data/models/usermodel/MyAccountParser.java index 509df7c..a3533aa 100644 --- a/app/src/main/java/com/objectivetruth/uoitlibrarybooking/data/models/usermodel/MyAccountParser.java +++ b/app/src/main/java/com/objectivetruth/uoitlibrarybooking/data/models/usermodel/MyAccountParser.java @@ -98,10 +98,11 @@ static private ArrayList _getBookingsList(MyAccountBookingType ArrayList returnArrayList = new ArrayList(); // Start at 2 because 0 is the empty string and 1 is the headers in the table + // also -1 on the length because the last row is a which isn't a full row // Example: " {"", "RoomDateFromTo - for(int i = 2; i < trStore.length; i++) { + for(int i = 2; i < trStore.length - 1; i++) { MyAccountBooking returnMyAccountBooking = new MyAccountBooking(); String[] tdElements = trStore[2].split(" _getBookingsList(MyAccountBookingType findStringFromStringBetweenSearchTerms(tdElements[2], ">", "", "", " 0; irow--) { TimeCell suspect = calendarDay.timeCells.get(_convertRowAndColumnToTimeCellIndex(irow, column)); if(suspect.timeCellType == BOOKING_CONFIRMED) { diff --git a/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/myaccount/myaccountloaded/BookingsAdapter.java b/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/myaccount/myaccountloaded/BookingsAdapter.java index 2ce4d27..8700d35 100644 --- a/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/myaccount/myaccountloaded/BookingsAdapter.java +++ b/app/src/main/java/com/objectivetruth/uoitlibrarybooking/userinterface/myaccount/myaccountloaded/BookingsAdapter.java @@ -8,6 +8,7 @@ import android.widget.TextView; import com.objectivetruth.uoitlibrarybooking.R; import com.objectivetruth.uoitlibrarybooking.data.models.usermodel.MyAccountBooking; +import timber.log.Timber; import java.util.ArrayList; @@ -47,7 +48,12 @@ public View getView(int position, View convertView, ViewGroup parent) { viewHolder.textView.setText(myAccountBooking.date); break; case 2: - String startAndEndTime = myAccountBooking.startTime + "-" + myAccountBooking.endTime; + String startAndEndTime = myAccountBooking.startTime; + if(startAndEndTime == null) { + startAndEndTime = ""; + Timber.w(new Throwable(new NullPointerException()), + "Starttime was null, which is never expected"); + } viewHolder.textView.setText(startAndEndTime); break; default: