WeserPlaner 1.1.0: implemented canteen view in CompactOverviewFragment.kt

This commit is contained in:
denizk0461
2023-06-04 20:45:38 +02:00
parent 35283f3544
commit 97b713a578
11 changed files with 688 additions and 188 deletions
@@ -1,17 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinator_layout"
android:id="@+id/root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.EventFragment">
tools:context=".fragment.CompactOverviewFragment">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true">
android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@@ -61,4 +64,171 @@
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_gravity="center_vertical"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@id/toolbar"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/field_timetable"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="8dp"
android:layout_marginTop="24dp">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text_event_header"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/compact_overview_header_events"
android:textSize="22sp"
android:layout_marginStart="8dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/button_timetable"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton"
android:id="@+id/button_timetable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
app:icon="@drawable/arrow_forward"
app:iconPadding="0dp"
app:strokeColor="?attr/colorOutlineVariant"
app:layout_constraintTop_toTopOf="@id/text_event_header"
app:layout_constraintBottom_toBottomOf="@id/text_event_header"
app:layout_constraintEnd_toEndOf="parent"
app:iconTint="?attr/colorOnSurfaceVariant"
tools:ignore="UnusedAttribute"
android:tooltipText="@string/compact_overview_button_events_hint"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/event_recycler_view"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginBottom="16dp"
android:paddingHorizontal="8dp"
android:scrollbars="vertical"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:layoutAnimation="@anim/layout_animation_fall_down"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/field_all_offers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="8dp"
android:paddingEnd="8dp"
android:paddingStart="16dp"
android:layout_marginBottom="4dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/button_refresh_offers"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text_offer_header"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:textSize="22sp"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"/>
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/text_offer_subheader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:focusable="true"
android:focusableInTouchMode="true"
android:scrollHorizontally="true"/>
</androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton.Outlined"
android:id="@+id/button_refresh_offers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
app:icon="@drawable/refresh"
app:iconPadding="0dp"
app:strokeColor="?attr/colorOutlineVariant"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/button_all_offers"
app:iconTint="?attr/colorOnSurfaceVariant"
tools:ignore="UnusedAttribute"
android:tooltipText="@string/compact_overview_button_offers_hint"/>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton"
android:id="@+id/button_all_offers"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
app:icon="@drawable/arrow_forward"
app:iconPadding="0dp"
app:strokeColor="?attr/colorOutlineVariant"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:iconTint="?attr/colorOnSurfaceVariant"
tools:ignore="UnusedAttribute"
android:tooltipText="@string/compact_overview_button_offers_hint"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/offer_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="8dp"
android:scrollbars="vertical"
android:clipToPadding="false"
android:scrollbarStyle="outsideOverlay"
android:layoutAnimation="@anim/layout_animation_fall_down"/>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
+10 -1
View File
@@ -25,12 +25,21 @@
</string-array>
<string name="introduction_welcome_header">Willkommen zu &app_name;!</string>
<string name="introduction_welcome_description">&app_name; ist eine inoffizielle App für Studierende der Universität Bremen, mit welcher du deinen Stundenplan immer griffbereit hast. Erstelle deine eigenen wöchentlichen Veranstaltungen und bearbeite sie, oder lade sie direkt von Stud.IP herunter.\n\nDu kannst außerdem alle Angebote aus den Mensen in Bremen und Bremerhaven einsehen. Filtere nach Präferenzen mit den Knöpfen oben am Bildschirm, oder gehe in die Einstellungen, um zu konfigurieren, gegen welche Stoffe du allergisch bist, und die App wird so gut wie möglich versuchen, dir nur Angebote zu zeigen, die relevant für dich sind.\n\nKlicke auf den Knopf unten, um deinen Stud.IP-Stundenplan direkt herunterzuladen! Solltest du dies überspringen, kannst du dies jederzeit in den Einstellungen der App nachholen.</string>
<string name="introduction_welcome_description">&app_name; ist eine inoffizielle App für Studierende der Universität Bremen, mit welcher du deinen Stundenplan immer griffbereit hast. Trage deine eigenen wöchentlichen Veranstaltungen ein und bearbeite sie, oder lade sie direkt von Stud.IP herunter.\n\nDu kannst außerdem alle Angebote aus den Mensen in Bremen und Bremerhaven einsehen. Filtere nach Präferenzen mit den Knöpfen oben am Bildschirm, oder gehe in die Einstellungen, um zu konfigurieren, gegen welche Stoffe du allergisch bist, und die App wird so gut wie möglich versuchen, dir nur Angebote zu zeigen, die relevant für dich sind.\n\nKlicke auf den Knopf unten, um deinen Stud.IP-Stundenplan direkt herunterzuladen! Solltest du dies überspringen, kannst du dies jederzeit in den Einstellungen der App nachholen.</string>
<string name="introduction_button_download">Lade deinen Stud.IP-Stundenplan herunter</string>
<string name="introduction_or"> oder </string>
<string name="introduction_button_continue">Gehe direkt zur App</string>
<string name="compact_overview_button_settings_hint">App-Einstellungen</string>
<string name="compact_overview_button_events_hint">Stundenplan</string>
<string name="compact_overview_button_refresh_offers_hint">Aktualisiere Angebote</string>
<string name="compact_overview_button_offers_hint">Alle Angebote</string>
<string name="compact_overview_header_events">Veranstaltungen heute</string>
<string name="compact_overview_header_offers">Im Angebot bei der %s</string>
<string name="compact_overview_subheader_offers_empty">Keine Infos verfügbar</string>
<string name="compact_overview_subheader_offers_no_news">Angebote vom %s</string>
<string name="compact_overview_subheader_offers_news">Angebote vom %s; Neuigkeiten verfügbar</string>
<string name="fragment_button_back_to_overview_hint">Zurück zur Übersicht</string>
<string name="fetch_error_snack">Ein Fehler ist aufgetreten!</string>
+10 -1
View File
@@ -26,12 +26,21 @@
</string-array>
<string name="introduction_welcome_header">Welcome to &app_name;!</string>
<string name="introduction_welcome_description">&app_name; is an unofficial companion app for students of the University of Bremen that allows you to keep your own schedule in close reach. Create your own weekly events and edit them as you wish, or download them straight from Stud.IP.\n\nYou can also view the offers for all of the canteens in Bremen and Bremerhaven. Filter by preferences using the buttons at the top of the canteen screen, or go into the settings to configure what substances you are allergic against, and the app will do its best to only show you offers that are relevant for you.\n\nClick the button below to download your schedule right away! If you skip this, you\'ll always have the option to download your schedule from the app\'s settings later.</string>
<string name="introduction_welcome_description">&app_name; is an unofficial companion app for students of the University of Bremen that allows you to keep your own schedule in close reach. Enter your own weekly events and edit them as you wish, or download them straight from Stud.IP.\n\nYou can also view the offers for all of the canteens in Bremen and Bremerhaven. Filter by preferences using the buttons at the top of the canteen screen, or go into the settings to configure what substances you are allergic against, and the app will do its best to only show you offers that are relevant for you.\n\nClick the button below to download your schedule right away! If you skip this, you\'ll always have the option to download your schedule from the app\'s settings later.</string>
<string name="introduction_button_download">Download your Stud.IP schedule</string>
<string name="introduction_or"> or </string>
<string name="introduction_button_continue">Continue to the app</string>
<string name="compact_overview_button_settings_hint">App settings</string>
<string name="compact_overview_button_events_hint">Timetable</string>
<string name="compact_overview_button_refresh_offers_hint">Refresh offers</string>
<string name="compact_overview_button_offers_hint">All offers</string>
<string name="compact_overview_header_events">Today\'s events</string>
<string name="compact_overview_header_offers">On offer at the %s</string>
<string name="compact_overview_subheader_offers_empty">No information available</string>
<string name="compact_overview_subheader_offers_no_news">Offers from %s</string>
<string name="compact_overview_subheader_offers_news">Offers from %s; news available</string>
<string name="fragment_button_back_to_overview_hint">Back to overview</string>
<string name="fetch_error_snack">Something went wrong!</string>