Further error handling. Also given the user the option to colour dietary preference icons. Colours have partially been derived from those used on stw-bremen.de but have all been processed through the theme builder on m3.material.io

This commit is contained in:
denizk0461
2023-04-29 22:26:26 +02:00
parent 2bf340bdff
commit 7243df0f06
21 changed files with 449 additions and 114 deletions
@@ -5,6 +5,7 @@ import com.denizk0461.studip.db.AppRepository
import com.denizk0461.studip.model.StudIPEvent
import org.jsoup.Jsoup
import java.io.IOException
import kotlin.jvm.Throws
/**
* Parser class used for fetching and collecting scheduled events from a Stud.IP timetable.
@@ -17,11 +18,10 @@ class StudIPParser(application: Application) {
* Parse a given HTML string. HTML must be of a Stud.IP timetable.
*
* @param html website content of the Stud.IP timetable
* @param insert action call to save the contents to persistent storage
* @throws IOException when an error in fetching or the database transaction occurs
*/
@kotlin.jvm.Throws(IOException::class)
fun parse(html: String, insert: (events: List<StudIPEvent>) -> Unit) {
@Throws(IOException::class)
fun parse(html: String) {
// Primary key value to uniquely identify entries in the database
var id = 0