diff --git a/app/build.gradle b/app/build.gradle index c062b82..70dd04b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "com.denizd.substitutionplan" minSdkVersion 21 targetSdkVersion 28 - versionCode 39 - versionName "2.3.1" + versionCode 40 + versionName "2.3.2" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/denizd/substitutionplan/data/HelperFunctions.kt b/app/src/main/java/com/denizd/substitutionplan/data/HelperFunctions.kt index 6f48969..1c0cade 100644 --- a/app/src/main/java/com/denizd/substitutionplan/data/HelperFunctions.kt +++ b/app/src/main/java/com/denizd/substitutionplan/data/HelperFunctions.kt @@ -341,20 +341,23 @@ internal object HelperFunctions { /** * Assigns a date priority to circumvent the event of the 1.12. being shown before the - * 31.11., essentially + * 31.11., essentially. Return value is based on the month, not the day * * @param date the date to be analysed * * @return an integer value to determine the ranking in the database */ fun assignDatePriority(date: String): Int { - val periodIndex = date.indexOf('.', 0, true) + if (date.isEmpty()) return 13 return try { + val periodIndex = date.indexOf('.', 0, true) date.substring(periodIndex + 1, date.length - 1).toInt() } catch (e: StringIndexOutOfBoundsException) { 0 } catch (n: NumberFormatException) { -1 + } catch (e: Exception) { + 13 } } diff --git a/app/src/main/java/com/denizd/substitutionplan/data/LoginWebViewClient.kt b/app/src/main/java/com/denizd/substitutionplan/data/LoginWebViewClient.kt index c4c458c..86b6543 100644 --- a/app/src/main/java/com/denizd/substitutionplan/data/LoginWebViewClient.kt +++ b/app/src/main/java/com/denizd/substitutionplan/data/LoginWebViewClient.kt @@ -26,7 +26,7 @@ internal class LoginWebViewClient(private val successListener: OnLoginSuccessLis override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) { super.onPageStarted(view, url, favicon) - if (!HelperFunctions.checkStringForArray(url.toString(), schoolUrls)) { + if (!HelperFunctions.checkStringForArray(url.toString(), schoolUrls, false)) { reloadLoginPage(webView = view) } } diff --git a/app/src/main/java/com/denizd/substitutionplan/fragments/SettingsFragment.kt b/app/src/main/java/com/denizd/substitutionplan/fragments/SettingsFragment.kt index 1749dc5..2924df0 100644 --- a/app/src/main/java/com/denizd/substitutionplan/fragments/SettingsFragment.kt +++ b/app/src/main/java/com/denizd/substitutionplan/fragments/SettingsFragment.kt @@ -93,7 +93,7 @@ internal class SettingsFragment : Fragment(R.layout.content_settings), View.OnCl colourCustomisationButton.setOnLongClickListener { if (!longPressed) { colourTextTitle.text = getString(R.string.made_by_deniz) - colourTextDesc.text = "---" + colourTextDesc.text = getString(R.string.thanks_for_using) } else { colourTextTitle.text = getString(R.string.customise_colours_title) colourTextDesc.text = getString(R.string.customise_colours_desc) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 2715871..f63176d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -161,4 +161,5 @@ Informationen über Sortierweisen Du kannst zwischen zwei Sortierweisen auswählen, welche die Reihenfolge der Einträge auf dem Vertretungsplan bestimmen.\n\nStandardmäßig ist \'App-spezifisch\' ausgewählt; dies bietet einen konsistenten Plan sortiert nach Klassen, dann nach Stunden.\n\n\'Website-Original\' bietet die Original-Reihenfolge der Website. Diese ist jedoch nicht konsistent, weswegen \'App-spezifisch\' standardmäßig ausgewählt ist. Ein Fehler ist aufgetreten, bitte versuche es erneut + Danke, dass du die App nutzt! \ 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 8f5aa5b..3c6f7d2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -173,4 +173,5 @@ Information on ordering systems You may pick between two ordering systems that dictate the order in which the items on the substitution plan will appear in.\n\nThe default \'app-specific\' is an algorithm implemented in this app that provides a consistently-sorted substitution plan ordered just like the substitution plan on the website used to; sorted by classes, then by time.\n\n\'Website original\' offers the items on the substitution plan just like they\'re presented on the school website, but since these are not guaranteed to be consistent, \'app-specific\' is picked by default. An error occurred, please try again + Thanks for using the app!