Archived
User can now select allergens to exclude from the canteen offers
This commit is contained in:
@@ -2,6 +2,7 @@ package com.denizk0461.studip.viewmodel
|
||||
|
||||
import android.app.Application
|
||||
import androidx.lifecycle.LiveData
|
||||
import com.denizk0461.studip.model.AllergenPreferences
|
||||
import com.denizk0461.studip.model.CanteenOffer
|
||||
import com.denizk0461.studip.model.DietaryPreferences
|
||||
import com.denizk0461.studip.model.SettingsPreferences
|
||||
@@ -25,6 +26,14 @@ class CanteenPageViewModel(app: Application) : AppViewModel(app) {
|
||||
*/
|
||||
fun getDietaryPrefs(): DietaryPreferences.Object = repo.getDietaryPrefsAsObject()
|
||||
|
||||
/**
|
||||
* This value determines which allergens the user wants to have displayed or hidden.
|
||||
*/
|
||||
val preferenceAllergenConfig: String
|
||||
get() = repo.getStringPreference(
|
||||
SettingsPreferences.ALLERGEN_CONFIG, defaultValue = AllergenPreferences.TEMPLATE
|
||||
)
|
||||
|
||||
/**
|
||||
* This value determines whether the user wants to have allergens marked.
|
||||
*/
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user