User can now select allergens to exclude from the canteen offers

This commit is contained in:
denizk0461
2023-05-01 19:17:35 +02:00
parent 79f8e9cfca
commit b0631d323e
17 changed files with 718 additions and 27 deletions
@@ -1,6 +1,7 @@
package com.denizk0461.studip.viewmodel
import android.app.Application
import com.denizk0461.studip.model.AllergenPreferences
import com.denizk0461.studip.model.SettingsPreferences
/**
@@ -56,6 +57,15 @@ class SettingsViewModel(app: Application) : AppViewModel(app) {
get() = repo.getBooleanPreference(SettingsPreferences.COURSE_HIGHLIGHTING)
set(newValue) { repo.setPreference(SettingsPreferences.COURSE_HIGHLIGHTING, newValue) }
/**
* This value determines which allergens the user wants to have displayed or hidden.
*/
var preferenceAllergenConfig: String
get() = repo.getStringPreference(
SettingsPreferences.ALLERGEN_CONFIG, defaultValue = AllergenPreferences.TEMPLATE
)
set(newValue) { repo.setPreference(SettingsPreferences.ALLERGEN_CONFIG, newValue) }
/**
* This value determines whether the user wants to have allergens marked.
*/