Archived
Fixed a bug that would stop the fetch when a date field is empty; version bump to 2.3.2
This commit is contained in:
+2
-2
@@ -10,8 +10,8 @@ android {
|
|||||||
applicationId "com.denizd.substitutionplan"
|
applicationId "com.denizd.substitutionplan"
|
||||||
minSdkVersion 21
|
minSdkVersion 21
|
||||||
targetSdkVersion 28
|
targetSdkVersion 28
|
||||||
versionCode 39
|
versionCode 40
|
||||||
versionName "2.3.1"
|
versionName "2.3.2"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -341,20 +341,23 @@ internal object HelperFunctions {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Assigns a date priority to circumvent the event of the 1.12. being shown before the
|
* 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
|
* @param date the date to be analysed
|
||||||
*
|
*
|
||||||
* @return an integer value to determine the ranking in the database
|
* @return an integer value to determine the ranking in the database
|
||||||
*/
|
*/
|
||||||
fun assignDatePriority(date: String): Int {
|
fun assignDatePriority(date: String): Int {
|
||||||
val periodIndex = date.indexOf('.', 0, true)
|
if (date.isEmpty()) return 13
|
||||||
return try {
|
return try {
|
||||||
|
val periodIndex = date.indexOf('.', 0, true)
|
||||||
date.substring(periodIndex + 1, date.length - 1).toInt()
|
date.substring(periodIndex + 1, date.length - 1).toInt()
|
||||||
} catch (e: StringIndexOutOfBoundsException) {
|
} catch (e: StringIndexOutOfBoundsException) {
|
||||||
0
|
0
|
||||||
} catch (n: NumberFormatException) {
|
} catch (n: NumberFormatException) {
|
||||||
-1
|
-1
|
||||||
|
} catch (e: Exception) {
|
||||||
|
13
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ internal class LoginWebViewClient(private val successListener: OnLoginSuccessLis
|
|||||||
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
|
override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
|
||||||
super.onPageStarted(view, url, favicon)
|
super.onPageStarted(view, url, favicon)
|
||||||
|
|
||||||
if (!HelperFunctions.checkStringForArray(url.toString(), schoolUrls)) {
|
if (!HelperFunctions.checkStringForArray(url.toString(), schoolUrls, false)) {
|
||||||
reloadLoginPage(webView = view)
|
reloadLoginPage(webView = view)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ internal class SettingsFragment : Fragment(R.layout.content_settings), View.OnCl
|
|||||||
colourCustomisationButton.setOnLongClickListener {
|
colourCustomisationButton.setOnLongClickListener {
|
||||||
if (!longPressed) {
|
if (!longPressed) {
|
||||||
colourTextTitle.text = getString(R.string.made_by_deniz)
|
colourTextTitle.text = getString(R.string.made_by_deniz)
|
||||||
colourTextDesc.text = "---"
|
colourTextDesc.text = getString(R.string.thanks_for_using)
|
||||||
} else {
|
} else {
|
||||||
colourTextTitle.text = getString(R.string.customise_colours_title)
|
colourTextTitle.text = getString(R.string.customise_colours_title)
|
||||||
colourTextDesc.text = getString(R.string.customise_colours_desc)
|
colourTextDesc.text = getString(R.string.customise_colours_desc)
|
||||||
|
|||||||
@@ -161,4 +161,5 @@
|
|||||||
<string name="ordering_systems_dialog_title">Informationen über Sortierweisen</string>
|
<string name="ordering_systems_dialog_title">Informationen über Sortierweisen</string>
|
||||||
<string name="ordering_systems_dialog_text">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.</string>
|
<string name="ordering_systems_dialog_text">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.</string>
|
||||||
<string name="error_please_try_again">Ein Fehler ist aufgetreten, bitte versuche es erneut</string>
|
<string name="error_please_try_again">Ein Fehler ist aufgetreten, bitte versuche es erneut</string>
|
||||||
|
<string name="thanks_for_using">Danke, dass du die App nutzt!</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -173,4 +173,5 @@
|
|||||||
<string name="ordering_systems_dialog_title">Information on ordering systems</string>
|
<string name="ordering_systems_dialog_title">Information on ordering systems</string>
|
||||||
<string name="ordering_systems_dialog_text">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.</string>
|
<string name="ordering_systems_dialog_text">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.</string>
|
||||||
<string name="error_please_try_again">An error occurred, please try again</string>
|
<string name="error_please_try_again">An error occurred, please try again</string>
|
||||||
|
<string name="thanks_for_using">Thanks for using the app!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user