Implemented functionality to switch canteens. UI for this is not fully implemented.

This commit is contained in:
denizk0461
2023-04-25 15:38:30 +02:00
parent 840c8f1db7
commit 6b1d77dfb3
21 changed files with 363 additions and 106 deletions
@@ -57,6 +57,17 @@ class ScheduleUpdateSheet(
).show((context as FragmentActivity).supportFragmentManager, "timePicker")
}
/*
* TODO implement option to change the colour for the course - single-selection coloured
* filter buttons with checkmarks when they're selected maybe?
*/
// Prepare cancel button
binding.buttonCancel.setOnClickListener {
// Do nothing and dismiss the sheet
dismiss()
}
// Prepare delete button
binding.buttonDelete.setOnClickListener {
onDelete(event)
@@ -67,6 +78,7 @@ class ScheduleUpdateSheet(
// Prepare update/save button
binding.buttonSave.setOnClickListener {
onUpdate(
// construct new StudIPEvent from the data the user may have edited
StudIPEvent(
id = event.id,
title = binding.editTextTitle.text.toString(),
@@ -98,7 +110,7 @@ class ScheduleUpdateSheet(
// If start > end, show an error
if ((isEventStart && newTimestamp.parseToMinutes() > timeslotEnd.parseToMinutes()) ||
(!isEventStart && newTimestamp.parseToMinutes() < timeslotStart.parseToMinutes())) {
// tell user that the timestamp must be set earlier/later
// TODO tell user that the timestamp must be set earlier/later
} else {
// If the new timestamp is valid, save it
if (isEventStart) {