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
@@ -11,23 +11,31 @@ import com.denizk0461.studip.model.SettingsPreferences
class SettingsViewModel(app: Application) : AppViewModel(app) {
/**
* This value determines whether the user opts into submitting crash reports.
* This value determines whether the user wants to have the next course in their schedule
* highlighted.
*/
var preferenceCourseHighlighting: Boolean
get() = repo.getPreference(SettingsPreferences.DATA_HANDLING)
set(newValue) { repo.setPreference(SettingsPreferences.DATA_HANDLING, newValue) }
get() = repo.getBooleanPreference(SettingsPreferences.COURSE_HIGHLIGHTING)
set(newValue) { repo.setPreference(SettingsPreferences.COURSE_HIGHLIGHTING, newValue) }
/**
* This value determines whether the user wants to have allergens marked.
*/
var preferenceAllergen: Boolean
get() = repo.getPreference(SettingsPreferences.ALLERGEN)
get() = repo.getBooleanPreference(SettingsPreferences.ALLERGEN)
set(newValue) { repo.setPreference(SettingsPreferences.ALLERGEN, newValue) }
/**
* This value determines whether the user wants the app to launch with the canteen view.
*/
var preferenceLaunchCanteen: Boolean
get() = repo.getBooleanPreference(SettingsPreferences.LAUNCH_CANTEEN_ON_START)
set(newValue) { repo.setPreference(SettingsPreferences.LAUNCH_CANTEEN_ON_START, newValue) }
/**
* This value determines whether the user opts into submitting crash reports.
*/
var preferenceDataHandling: Boolean
get() = repo.getPreference(SettingsPreferences.DATA_HANDLING)
get() = repo.getBooleanPreference(SettingsPreferences.DATA_HANDLING)
set(newValue) { repo.setPreference(SettingsPreferences.DATA_HANDLING, newValue) }
}