-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dining redesign: open until subtitle, updated day chips, availability card redesign, improved chart and menus #48
Merged
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
2098eda
added date to day chips by making chips into radiobuttons
kaushikravikumar 4c66c5c
removed lite_lunch logic, since its grouped with lunch in dining menu…
kaushikravikumar fc468a5
made toolbar include subtitle with openclose info
kaushikravikumar 2b478a0
moved parseTime function to fluxutil
kaushikravikumar f4960d4
added next day to facilityhours endpoint
kaushikravikumar 3805277
removed duplicate operating hours request
kaushikravikumar 5dd527f
created two separate variables to store operating hours: one for chec…
kaushikravikumar c4e3857
added curr date textview
kaushikravikumar dd50c58
changed so open/closed text only colors red or green for open or clos…
kaushikravikumar 9c6779a
removed extra line
kaushikravikumar 9c0698d
Bump Gradle, package versions
kungpaogao 5243351
Implement dynamic chips (shows today first)
kungpaogao e658a89
Remove unnecessary outline
kungpaogao 47758a5
Format code
kungpaogao 989e567
Implement basic layout for new availability card
kungpaogao 7cdbde8
Availability number now updates according to crowdedness
kungpaogao 9753081
Availability card displays live max capacity
kungpaogao 154c8b3
made all dates yyyy-mm-dd
kaushikravikumar 658abd4
fixed double loading of historical chart bug
kaushikravikumar a2fe498
Move section headers outside of card
kungpaogao aa9fa53
Merge branch 'dining_redesign' of https://github.com/cornell-dti/camp…
kungpaogao 450baef
Implement color changes for availability card
kungpaogao 25ac06b
Update green/teal color
kungpaogao e2b6ba0
Update menu UI to match design mockups
kungpaogao ee75f8d
added last updated text
kaushikravikumar a9af916
merge branch 'dining_redesign' of https://github.com/cornell-dti/camp…
kaushikravikumar ab97968
changed color of is it accurate text
kaushikravikumar ab79278
fixed spacing between last updated text and next component below and …
kaushikravikumar 8a44223
Fix operating hours not displaying on Android
kungpaogao 9223977
Update spacing for operating hours in historical data card
kungpaogao 42c532f
Merge remote-tracking branch 'origin/dining_redesign' into dining_red…
kungpaogao 995f337
Fix layout scaling for date selection buttons
kungpaogao 975977e
Implement graying out of chart + other chart improvements
kungpaogao File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,24 +118,15 @@ class API(context: Context) { | |
fun fetchHistoricalJSON( | ||
day: String, | ||
facilityId: String, | ||
fetchOperatingHoursOnResponse: (operatingHours: List<String>) -> Unit, | ||
fetchHistoricalJSONOnResponse: (densities: List<Double>) -> Unit | ||
) { | ||
val operatingHoursRequest = getRequest( | ||
url = "$OPERATING_HOURS_ENDPOINT?id=$facilityId&startDate=${FluxUtil.getDate(day)}&endDate=${FluxUtil.getDate(day)}", | ||
onResponse = { response -> | ||
fetchOperatingHoursOnResponse(JsonParser.parseOperatingHours(response)) | ||
}, | ||
onError = { error -> Log.d("ERROR MESSAGE", error.toString()) } | ||
) | ||
val historicalDataRequest = getRequest( | ||
url = "$HISTORICAL_DATA_ENDPOINT?id=$facilityId", | ||
onResponse = { response -> | ||
fetchHistoricalJSONOnResponse(JsonParser.parseHistorical(response, day)) | ||
}, | ||
onError = { error -> Log.d("ERROR MESSAGE", error.toString()) } | ||
) | ||
queue.add(operatingHoursRequest) | ||
queue.add(historicalDataRequest) | ||
} | ||
|
||
|
@@ -173,11 +164,13 @@ class API(context: Context) { | |
queue.add(menuRequest) | ||
} | ||
|
||
fun facilityHours(facilityId: String, startDate: String, endDate: String, facilityHoursOnResponse: (List<Pair<Long, Long>>) -> Unit) { | ||
fun facilityHours(facilityId: String, startDate: String, endDate: String, facilityHoursTimeStampsOnResponse: (List<Pair<Long, Long>>) -> Unit, | ||
facilityHoursStringsOnResponse: (List<String>) -> Unit) { | ||
val facilityHoursRequest = getRequest( | ||
url = "$OPERATING_HOURS_ENDPOINT?id=$facilityId&startDate=$startDate&endDate=$endDate", | ||
onResponse = { response -> | ||
facilityHoursOnResponse(JsonParser.parseOperatingHoursToTimestampList(response)) | ||
facilityHoursTimeStampsOnResponse(JsonParser.parseOperatingHoursToTimestampList(response)) | ||
facilityHoursStringsOnResponse(JsonParser.parseOperatingHours(response)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good, makes sense to pair these together |
||
}, | ||
onError = { | ||
error -> Log.d("Error fetching hours", error.networkResponse.toString()); | ||
|
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 |
---|---|---|
|
@@ -33,22 +33,33 @@ object FluxUtil { | |
} | ||
|
||
/** | ||
* getDate(day) provides the date for historical endpoint request. | ||
* getDateString(day) provides the date in string format for historical endpoint request. | ||
*/ | ||
fun getDate(day: String): String { | ||
fun getDateObject(day: String): Date { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. did the documentation get mixed up? |
||
val current = Calendar.getInstance() | ||
val format = SimpleDateFormat("MM-dd-yy", Locale.US) | ||
val checkFormat = SimpleDateFormat("E", Locale.US) | ||
|
||
var dayCheck = checkFormat.format(current.time).toUpperCase(Locale.US) | ||
while (dayCheck != day) { | ||
current.add(Calendar.DAY_OF_MONTH, 1) | ||
dayCheck = checkFormat.format(current.time).toUpperCase(Locale.US) | ||
} | ||
return current.time | ||
} | ||
|
||
return format.format(current.time) | ||
/** | ||
* convertDateObjectToString(day) provides the date in string format for historical and operating hours endpoint request. | ||
*/ | ||
fun convertDateObjectToString(date: Date): String { | ||
val format = SimpleDateFormat("MM-dd-yy", Locale.US) | ||
return format.format(date) | ||
} | ||
|
||
/** | ||
* getDateObject(day) provides date object for operating hours endpoint request | ||
*/ | ||
|
||
|
||
fun getDayDifference(currentDay: String, tappedDay: String): Int { | ||
var x: Int = daysList.indexOf(currentDay) | ||
var count = 0 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will things get messed up if
opHoursStrings
is not set in time for the UI updates?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it won't throw an error since it's just an empty list...