diff --git a/app/src/main/java/com/denizk0461/studip/adapter/StudIPEventItemAdapter.kt b/app/src/main/java/com/denizk0461/studip/adapter/StudIPEventItemAdapter.kt index d748eed..f71a422 100644 --- a/app/src/main/java/com/denizk0461/studip/adapter/StudIPEventItemAdapter.kt +++ b/app/src/main/java/com/denizk0461/studip/adapter/StudIPEventItemAdapter.kt @@ -73,22 +73,11 @@ class StudIPEventItemAdapter( // Use parsed timeslot string as defined in StudIPEvent#timeslot() holder.binding.textTimeslot.text = currentItem.timeslot() - // TODO highlighting functionality is currently not supported! - // Set up colours used for highlighting and un-highlighting an item. -// val colorPrimaryTranslucent = TypedValue() -// val colorCardBackground = TypedValue() -// val colorTextHintLighter = TypedValue() - - // Resolve themed attributes to get the right values for day and night modes -// holder.binding.root.context.theme.apply { -// resolveAttribute(com.google.android.material.R.attr.colorSecondaryContainer, colorPrimaryTranslucent, true) -// resolveAttribute(R.attr.colorCardBackground, colorCardBackground, true) -// resolveAttribute(R.attr.colorTextHintLighter, colorTextHintLighter, true) -// } - + // Get current theme val theme = holder.binding.root.context.theme - /* Highlight the next upcoming course of the day if the day of the adapter matches the + /* + * Highlight the next upcoming course of the day if the day of the adapter matches the * current day, and if no other course has been highlighted, to avoid double highlighting. */ if (!isAnyCourseHighlighted && currentItem.isCurrentCourse(currentCalendar)) { @@ -102,6 +91,8 @@ class StudIPEventItemAdapter( // Hide card stroke strokeColor = context.getColor(android.R.color.transparent) } + // Set the divider colour to the text colour + holder.binding.divider.dividerColor = theme.getThemedColor(com.denizk0461.studip.R.attr.colorText) // Otherwise, apply colours to ensure that the item will not be highlighted } else { holder.binding.cardBackground.apply { @@ -109,8 +100,10 @@ class StudIPEventItemAdapter( backgroundTintList = ColorStateList.valueOf(theme.getThemedColor(R.attr.colorSurface)) // Set the card's stroke to its default colour - strokeColor = theme.getThemedColor(R.attr.colorOutlineVariant) + strokeColor = theme.getThemedColor(R.attr.colorOutline) } + // Set the divider colour to its default value + holder.binding.divider.dividerColor = theme.getThemedColor(R.attr.colorOutlineVariant) } // Set up single click listener diff --git a/app/src/main/java/com/denizk0461/studip/fragment/CanteenFragment.kt b/app/src/main/java/com/denizk0461/studip/fragment/CanteenFragment.kt index ade44b8..900c4ab 100644 --- a/app/src/main/java/com/denizk0461/studip/fragment/CanteenFragment.kt +++ b/app/src/main/java/com/denizk0461/studip/fragment/CanteenFragment.kt @@ -2,7 +2,6 @@ package com.denizk0461.studip.fragment import android.os.Bundle import android.view.LayoutInflater -import android.view.MenuItem import android.view.View import android.view.ViewGroup import androidx.appcompat.widget.PopupMenu @@ -59,7 +58,7 @@ class CanteenFragment : AppFragment(), CanteenOfferItemAdapter.OnClickListener { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - // TODO KDoc and finish + // Open the menu for the canteen picker button binding.buttonCanteenPicker.setOnClickListener { PopupMenu(binding.root.context, binding.buttonCanteenPicker).apply { setOnMenuItemClickListener { item -> @@ -76,8 +75,13 @@ class CanteenFragment : AppFragment(), CanteenOfferItemAdapter.OnClickListener { R.id.mensa_hfk -> 9 else -> 0 } - // Set currently selected canteen to the button + // Set newly selected canteen to the button binding.buttonCanteenPicker.text = getCurrentlySelectedCanteenName() + + // Display to the user that the canteen plan will be refreshed + binding.swipeRefreshLayout.isRefreshing = true + + // Refresh the canteen menu for the newly selected canteen refresh() true } @@ -86,6 +90,9 @@ class CanteenFragment : AppFragment(), CanteenOfferItemAdapter.OnClickListener { } } + // Set currently selected canteen to the button + binding.buttonCanteenPicker.text = getCurrentlySelectedCanteenName() + binding.buttonInfo.setOnClickListener { openBottomSheet( TextSheet( diff --git a/app/src/main/java/com/denizk0461/studip/fragment/SettingsFragment.kt b/app/src/main/java/com/denizk0461/studip/fragment/SettingsFragment.kt index af095a8..415e5c0 100644 --- a/app/src/main/java/com/denizk0461/studip/fragment/SettingsFragment.kt +++ b/app/src/main/java/com/denizk0461/studip/fragment/SettingsFragment.kt @@ -94,6 +94,16 @@ class SettingsFragment : AppFragment() { )) } + // Set click listener for showing licences dialogue + binding.buttonLicences.setOnClickListener { + openBottomSheet( + TextSheet( + getString(R.string.sheet_licences_header), + getString(R.string.sheet_licences_content), + ) + ) + } + // Set click listener for the app version button binding.buttonAppVersion.setOnClickListener { when (appVersionClick) { diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index 46c0743..a162737 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -353,6 +353,34 @@ + + + + + + + + + Dozierende(r) Raum + Lizenzen + Dein Stundenplan Mensenangebote App-Einstellungen @@ -128,6 +130,9 @@ TL;DR: nein, aber Google könnte mir Bescheid geben, falls die App mal abstürzt. Die App funktioniert standalone, was bedeutet, dass sie sich niemals mit einem Server verbindet, der mir gehört. Sie ist ein Web-Scraper, also ein Programm, welches eine Internetseite öffnet und dann all die Informationen dieser Webseite herunterlädt und analysiert. In diesem Fall sind es die Webseiten der Mensen und Cafeterien des Studierendenwerks Bremen (stw-bremen.de) sowie die Stud.IP-Seite (elearning.uni-bremen.de).\n\nDies funktioniert relativ einfach für die Essenspläne, da diese Pläne öffentlich zugänglich sind. Um jedoch Deinen persönlichen Stud.IP-Stundenplan herunterzuladen, braucht die App Zugriff auf diese Webseite während Dein Account eingeloggt ist. Dies erfolgt, indem die App Dich mit deinem Account einloggen lässt - dies geschieht, wenn Du den Knopf zum Aktualisieren des Plans drückst und die App Dir die Login-Seite zeigt - und Du dann den Knopf klickst, um den Inhalt, den HTML-Quellcode, herunterzuladen. Der HTML-Quellcode beinhält Informationen darüber, was auf einer Webseite angezeigt wird und wie es aussehen soll, aber er kann niemals persönliche Details beinhalten, wie zum Beispiel Passwörter oder andere Daten, die auf Deinem Gerät vorhanden sind.\n\nDer Quellcode wird dann lokal, also auf Deinem Gerät, zu den Karten verarbeitet, die Du dann in der App sehen kannst, ohne, dass jegliche Daten irgendwohin geschickt werden müssten.\n\nEinige Daten könnten jedoch dennoch nach außen geschickt werden. Diese App nutzt \"Crashlytics\" von Google. Dies ist ein Tool, welches Absturzreporte an Google-Server schickt, wenn in der App etwas schief läuft. Diese werden genutzt, um Probleme in der App zu lösen.\n\nDies ist jedoch gemäß europäischer Datenschutz-Grundverordnung Opt-In, was bedeutet, dass Du zustimmen musst, bevor Daten nach außen geschickt werden. Du wurdest danach gefragt, als Du die App zum ersten Mal gestartet hast, und du kannst jederzeit deine Meinung ändern, indem Du den Schalter hierfür in den Einstellungen umstellst. Solltest Du dich entscheiden, keine Daten verschicken zu lassen, wird auch nichts mit Google (und mir) geteilt.\n\nSolltest du dich versichern wollen, dass wirklich keine Daten an irgendwelche Server verschickt wird (abgesehen von den Absturzreports an Google), kannst Du jederzeit das Projekt erkunden, da es Open-Source und auf meinen GitHub-Profil öffentlich zugänglich ist:\nhttps://github.com/denizk0461/studip-timetable/\n\nSchreib mir ansonsten gerne eine E-Mail:\ndenizk0461+kyzil@gmail.com + Siehe Lizenzen + Ressourcen, die diese App möglich gemacht haben + App-Version mit ♡️ aus Bremen-Osterholz\von denizk0461 \\__* diff --git a/app/src/main/res/values-night/themes.xml b/app/src/main/res/values-night/themes.xml index f4108e0..7e94765 100644 --- a/app/src/main/res/values-night/themes.xml +++ b/app/src/main/res/values-night/themes.xml @@ -29,6 +29,7 @@ @color/md_theme_dark_inversePrimary @color/md_theme_dark_onSurfaceVariant + @color/md_theme_dark_onSurfaceVariant @color/md_theme_dark_onSurfaceVariant @color/md_theme_dark_outlineVariant diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index f4cbc3e..6e1fc20 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -8,4 +8,6 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4719e83..0583c21 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -20,6 +20,9 @@ Room + Licences + 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/ + Your Schedule Canteen Offers App Settings @@ -112,7 +115,7 @@ This will clear any customisations! Highlight next course - Only works properly if courses don\'t overlap!\nNOTE: Currently broken! + Only works properly if courses don\'t overlap! Use academic quarter Where applicable @@ -131,6 +134,8 @@ TL;DR: no, but Google may let me know if the app crashes on your device. This app works standalone, which is to say, it doesn\'t ever connect to a server I own. Instead, it is a web scraper, which means that it opens a website and then downloads and analyses all the data from that website by itself. In this case, those websites are the canteen websites of the Studierendenwerk Bremen (stw-bremen.de) and the Stud.IP page (elearning.uni-bremen.de).\n\nThis works fairly easily for the canteen offers, since the plans are public and anyone can access them. However, to access your personal Stud.IP schedule, the app needs access to that website, with your account logged in. This is done by letting you log into the website by yourself (which happens when you click the button to refresh the schedule and the app opens the login page) and then clicking a button to download the content, the HTML source code, of the website. The HTML source code contains information about which elements are shown on the website and how they look, but it can never contain your personal details such as passwords, or any other sensitive data you may store on your device.\n\nThe HTML source is then processed locally on your device, which means that your device will handle converting the HTML source to the cards you will be shown in the app by itself, without needing to send any data anywhere.\n\nHowever, some data may still be sent outside of your device. This app uses \"Crashlytics\" by Google, which is a tool that sends crash reports to Google servers if something breaks. These are used to fix problems that occur in the app.\n\nThis, in compliance with the European General Data Protection Regulation, is of course opt-in, which means that you need to accept this before any data is sent outside of your device. You have been prompted for this when you first started the app, and you can always change your mind in the app settings by clicking the corresponding switch. Should you choose to not share crash data with Google (and me), no data will be sent outside of your device.\n\nShould you want to reassure yourself that no data is sent to any servers (outside of the crash reports from Google), feel free to explore the project, since it is open-source and documented on my GitHub profile:\nhttps://github.com/denizk0461/studip-timetable/\n\nYou\'re also welcome to send me an email:\ndenizk0461+kyzil@gmail.com + View licences + Resources that made this app possible App Version with ♡️ from Bremen-Osterholz\nmade by denizk0461 \\__* diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 336c40c..e55b000 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -29,6 +29,7 @@ @color/md_theme_light_inversePrimary @color/md_theme_light_onSurfaceVariant + @color/md_theme_light_onSurfaceVariant @color/md_theme_light_onSurfaceVariant @color/md_theme_light_outlineVariant