Added functionality to view news for a canteen; fixed a bug that would prevent the offers from being fetched for canteens without news; BUG: news are still a bit buggy, check for crashes

This commit is contained in:
denizk0461
2023-05-09 12:22:40 +02:00
parent b42118ed94
commit 6cbfe71e62
13 changed files with 93 additions and 33 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,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z"/>
</vector>
+38 -19
View File
@@ -17,23 +17,48 @@
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<TextView
android:id="@+id/app_title_bar"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_food"
android:textSize="28sp"
android:fontFamily="@font/lato_bolditalic"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"/>
android:layout_marginBottom="8dp">
<TextView
android:id="@+id/app_title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/title_food"
android:textSize="28sp"
android:fontFamily="@font/lato_bolditalic"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/button_notifications"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.TextButton"
android:id="@+id/button_notifications"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
android:layout_marginStart="8dp"
app:icon="@drawable/notification"
app:iconPadding="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:iconTint="?attr/colorOnSurfaceVariant"
android:visibility="gone"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<HorizontalScrollView
android:id="@+id/scroll_view_chip"
@@ -250,10 +275,4 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- <androidx.coordinatorlayout.widget.CoordinatorLayout-->
<!-- android:id="@+id/snackbar_container"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="bottom"/>-->
</androidx.coordinatorlayout.widget.CoordinatorLayout>
+1
View File
@@ -63,6 +63,7 @@
<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_news_sheet_title">Neuigkeiten für diese Mensa</string>
<string name="canteen_fab_opening_hours_content_desc">Zeige Öffnungszeiten</string>
<string name="canteen_fab_switch_canteen_content_desc">Wechsle Mensa</string>
<string name="canteen_fab_refresh_content_desc">Aktualisiere Angebote</string>
+1
View File
@@ -64,6 +64,7 @@
<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_news_sheet_title">News for this canteen</string>
<string name="canteen_fab_opening_hours_content_desc">Show opening hours</string>
<string name="canteen_fab_switch_canteen_content_desc">Switch canteen</string>
<string name="canteen_fab_refresh_content_desc">Refresh offers</string>