Implemented functionality for adding a new event manually; added floating action buttons for adding an event and refreshing the canteen offers

This commit is contained in:
denizk0461
2023-05-03 14:16:32 +02:00
parent ae8db7ce48
commit df1d127a17
18 changed files with 416 additions and 155 deletions
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M12,22H5c-1.11,0 -2,-0.9 -2,-2L3.01,6c0,-1.1 0.88,-2 1.99,-2h1V2h2v2h8V2h2v2h1c1.1,0 2,0.9 2,2v6h-2v-2H5v10h7V22zM22.13,16.99l0.71,-0.71c0.39,-0.39 0.39,-1.02 0,-1.41l-0.71,-0.71c-0.39,-0.39 -1.02,-0.39 -1.41,0l-0.71,0.71L22.13,16.99zM21.42,17.7l-5.3,5.3H14v-2.12l5.3,-5.3L21.42,17.7z"/>
</vector>
+5
View File
@@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
+38 -21
View File
@@ -17,19 +17,32 @@
android:orientation="vertical"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<androidx.appcompat.widget.LinearLayoutCompat
<com.google.android.material.button.MaterialButton
android:id="@+id/button_canteen_picker"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_gravity="start"
android:layout_marginStart="8dp"
android:fontFamily="@font/lato_bolditalic"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
android:layout_marginHorizontal="16dp">
<com.google.android.material.button.MaterialButton
android:id="@+id/button_canteen_picker"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="wrap_content"
<TextView
android:id="@+id/app_title_bar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textSize="18sp"
android:layout_gravity="start"
android:fontFamily="@font/lato_bolditalic"/>
android:text="@string/title_food"
android:textSize="32sp"
android:fontFamily="@font/lato_bolditalic"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/button_info"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.TextButton"
@@ -39,19 +52,13 @@
android:minWidth="0dp"
app:icon="@drawable/info"
app:iconPadding="0dp"
android:layout_gravity="end"
app:iconTint="?attr/colorOnSurfaceVariant"/>
android:layout_gravity="center_vertical|end"
app:iconTint="?attr/colorOnSurfaceVariant"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<TextView
android:id="@+id/app_title_bar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:text="@string/title_food"
android:textSize="32sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginHorizontal="16dp"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<HorizontalScrollView
android:id="@+id/scroll_view_chip"
@@ -215,6 +222,16 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_refresh_offers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/refresh"
android:contentDescription="@string/canteen_fab_refresh_content_desc"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"/>
<!-- <androidx.coordinatorlayout.widget.CoordinatorLayout-->
<!-- android:id="@+id/snackbar_container"-->
<!-- android:layout_width="0dp"-->
+14 -4
View File
@@ -14,14 +14,14 @@
<TextView
android:id="@+id/app_title_bar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/title_schedule"
android:textSize="32sp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginTop="16dp"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"/>
app:layout_scrollFlags="scroll|exitUntilCollapsed"/>
<com.google.android.material.tabs.TabLayout
android:id="@+id/day_tab_layout"
@@ -38,4 +38,14 @@
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_add_event"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/plus"
android:contentDescription="@string/sheet_schedule_update_header_add"
android:layout_gravity="bottom|end"
android:layout_marginEnd="@dimen/fab_margin"
android:layout_marginBottom="@dimen/fab_margin"/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
@@ -15,8 +15,8 @@
<TextView
android:id="@+id/app_title_bar"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:fontFamily="@font/lato_bolditalic"
@@ -18,11 +18,11 @@
android:layout_marginBottom="8dp">
<TextView
android:id="@+id/sheet_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="22sp"
android:fontFamily="@font/lato_blackitalic"
android:text="@string/sheet_schedule_update_header"
android:layout_gravity="start|center_vertical"
android:paddingHorizontal="24dp"/>
@@ -125,6 +125,14 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.button.MaterialButton
android:id="@+id/button_day"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
app:icon="@drawable/edit_calendar"
android:layout_gravity="end"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/button_academic_quarter"
android:layout_width="wrap_content"
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/monday"
android:title="@string/monday"
android:enabled="true"/>
<item
android:id="@+id/tuesday"
android:title="@string/tuesday"
android:enabled="true"/>
<item
android:id="@+id/wednesday"
android:title="@string/wednesday"
android:enabled="true"/>
<item
android:id="@+id/thursday"
android:title="@string/thursday"
android:enabled="true"/>
<item
android:id="@+id/friday"
android:title="@string/friday"
android:enabled="true"/>
<item
android:id="@+id/saturday"
android:title="@string/saturday"
android:enabled="true"/>
<item
android:id="@+id/sunday"
android:title="@string/sunday"
android:enabled="true"/>
</menu>
+4 -1
View File
@@ -43,7 +43,8 @@
<string name="sheet_schedule_update_delete_confirm">Sicher?</string>
<string name="cancel">Abbrechen</string>
<string name="confirm">Bestätigen</string>
<string name="sheet_schedule_update_header">Veranstaltung bearbeiten</string>
<string name="sheet_schedule_update_header_edit">Veranstaltung bearbeiten</string>
<string name="sheet_schedule_update_header_add">Veranstaltung hinzufügen</string>
<string name="sheet_schedule_update_title_hint">Veranstaltungstitel</string>
<string name="sheet_schedule_update_lecturers_hint">Dozierende(r)</string>
<string name="sheet_schedule_update_room_hint">Raum</string>
@@ -51,9 +52,11 @@
<string name="sheet_schedule_update_hint_quarter_error">Sorry, ein Fehler ist aufgetreten!</string>
<string name="sheet_schedule_update_timestamp_error_start">Der Kurs kann nicht anfangen nachdem er aufhört!</string>
<string name="sheet_schedule_update_timestamp_error_end">Der Kurs kann nicht enden bevor er anfängt!</string>
<string name="sheet_schedule_update_text_field_empty_error">Dieses Feld darf nicht leer sein</string>
<string name="canteen_no_offer_header">Kein Angebot</string>
<string name="canteen_no_offer_desc">Für diesen Tag sind keine Angebote vorhanden</string>
<string name="canteen_fab_refresh_content_desc">Aktualisiere Angebote</string>
<string name="sheet_licences_header">Lizenzen</string>
+4 -1
View File
@@ -43,7 +43,8 @@
<string name="sheet_schedule_update_delete_confirm">Sure?</string>
<string name="cancel">Cancel</string>
<string name="confirm">Confirm</string>
<string name="sheet_schedule_update_header">Edit Event</string>
<string name="sheet_schedule_update_header_edit">Edit event</string>
<string name="sheet_schedule_update_header_add">Add event</string>
<string name="sheet_schedule_update_title_hint">Event title</string>
<string name="sheet_schedule_update_lecturers_hint">Lecturer(s)</string>
<string name="sheet_schedule_update_room_hint">Room</string>
@@ -52,9 +53,11 @@
<string name="sheet_schedule_update_hint_quarter_error">Sorry, an error occurred!</string>
<string name="sheet_schedule_update_timestamp_error_start">The course can\'t begin after it ends!</string>
<string name="sheet_schedule_update_timestamp_error_end">The course can\'t end before it begins!</string>
<string name="sheet_schedule_update_text_field_empty_error">This field cannot be empty</string>
<string name="canteen_no_offer_header">No offers</string>
<string name="canteen_no_offer_desc">There are no offers available for this day</string>
<string name="canteen_fab_refresh_content_desc">Refresh offers</string>
<string name="sheet_licences_header">Licences</string>
<string name="sheet_licences_content" translatable="false">Android developer resources provided by Google.\nhttps://developer.android.com/\n\nCrash reporting provided by Google.\nhttps://firebase.google.com/products/crashlytics/\n\nDesign guidelines, icons, and colour palette provided by Google.\nhttps://m3.material.io/\n\nAdditional icons provided by Flaticon.\nhttps://www.flaticon.com/\n\nWeb scraping functionality provided by Jonathan Hedley.\nhttps://jhy.io/ | https://jsoup.org/</string>