From 2e4f423586da1e16e65fdc5e35ba48f03fe71162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deniz=20D=C3=BCzg=C3=B6ren?= Date: Wed, 25 Sep 2019 10:57:21 +0200 Subject: [PATCH] Fixed a bug in HelperFunctions#assignRanking --- .../com/denizd/substitutionplan/data/HelperFunctions.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 46f60ac..0ef00a1 100644 --- a/app/src/main/java/com/denizd/substitutionplan/data/HelperFunctions.kt +++ b/app/src/main/java/com/denizd/substitutionplan/data/HelperFunctions.kt @@ -52,6 +52,8 @@ internal object HelperFunctions { */ val cancellations = arrayOf("eigenverantwortliches arbeiten", "entfall", "entfällt", "fällt aus", "freisetzung", "vtr. ohne lehrer") + private val juniors = arrayOf("5", "6", "7", "8", "9") + private val colourIntegers = intArrayOf( 0, R.color.bgRed, @@ -256,7 +258,7 @@ internal object HelperFunctions { /** * This function is used throughout some classes to set the theme according to the device's * Android version before an app theme may be picked in the settings. As Main.kt as well as - * SettingsFragment.kt are only accessible after the inital setup and serve slightly + * SettingsFragment.kt are only accessible after the initial setup and serve slightly * different purposes, they use their own implementations */ fun setTheme(window: Window, context: Context) { @@ -278,7 +280,7 @@ internal object HelperFunctions { } /** - * Returns the notification channel that is reponsible for handling substitution notifications + * Returns the notification channel that is responsible for handling substitution notifications * on Android Oreo and above. If it does not exist, this function creates it * * @param context the context used for gathering the notification system service @@ -331,10 +333,7 @@ internal object HelperFunctions { } else -> -29 } - } catch (e: StringIndexOutOfBoundsException) { - 0 } catch (e: Exception) { - e.printStackTrace() 0 } }