Replaced fragment switching functionality in MainActivity.kt with Navigation component, simplifying logic significantly; upgraded to AGP 8.0.1

This commit is contained in:
denizk0461
2023-05-02 20:52:56 +02:00
parent 51c4c9120b
commit 36a7ae0035
12 changed files with 73 additions and 119 deletions
@@ -15,7 +15,10 @@ class SettingsViewModel(app: Application) : AppViewModel(app) {
* highlighted.
*/
var preferenceCourseHighlighting: Boolean
get() = repo.getBooleanPreference(SettingsPreferences.COURSE_HIGHLIGHTING)
get() = repo.getBooleanPreference(
SettingsPreferences.COURSE_HIGHLIGHTING,
defaultValue = true
)
set(newValue) { repo.setPreference(SettingsPreferences.COURSE_HIGHLIGHTING, newValue) }
/**
@@ -36,7 +39,7 @@ class SettingsViewModel(app: Application) : AppViewModel(app) {
* This value determines which canteen the user has selected.
*/
var preferenceColour: Boolean
get() = repo.getBooleanPreference(SettingsPreferences.COLOUR_PREFS)
get() = repo.getBooleanPreference(SettingsPreferences.COLOUR_PREFS, defaultValue = true)
set(newValue) { repo.setPreference(SettingsPreferences.COLOUR_PREFS, newValue) }
/**