Implemented functionality to switch canteens. UI for this is not fully implemented.

This commit is contained in:
denizk0461
2023-04-25 15:38:30 +02:00
parent 840c8f1db7
commit 6b1d77dfb3
21 changed files with 363 additions and 106 deletions
@@ -1,5 +1,10 @@
package com.denizk0461.studip.data
import android.content.res.Resources
import android.util.TypedValue
import androidx.annotation.AttrRes
import com.denizk0461.studip.R
/**
* Miscellaneous functions and variables that don't belong into any specific class.
*/
@@ -15,6 +20,16 @@ fun String.parseToMinutes(): Int {
return (parts[0].toInt() * 60) + parts[1].toInt()
}
/**
* Retrieves a specified colour customised to the currently applied theme.
*
* @param id attribute ID of the colour reference
* @return resolved colour
*/
fun Resources.Theme.getThemedColor(@AttrRes id: Int): Int = TypedValue().also { value ->
resolveAttribute(id, value, true)
}.data
object Misc {
// private val timeslotAcademicQuarter = mapOf(