App theme preference (Light / Dark / System) has no effect #23
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
The Settings screen exposes a "Theme" preference (Light / Dark / System) backed by
AppPreference.appTheme()(domain/preference/AppPreference.kt:15). Selecting a value persists it, but the change has no effect on the app — the UI always follows the system theme.Root cause
AppThemeinapp/src/main/java/dev/achmad/ledgerr/ui/theme/Theme.kt:20only acceptsdarkTheme: Boolean = isSystemInDarkTheme(). Nothing readsAppPreference.appTheme()and passes the resolved value in, so the preference is effectively dead. Search confirms there are no other call sites forappTheme()orAppThemeother than the default parameter.Expected behavior
Choosing Light in Settings forces light mode regardless of system setting; Dark forces dark; System follows the device. The change should take effect immediately (no app restart) and survive process death.
Acceptance criteria
SettingsScreenre-themes the app live.SYSTEMfollowsisSystemInDarkTheme()(current device setting).Suggested approach (not prescriptive)
State<AppTheme>/Flow<AppTheme>accessor onAppPreference(or expose it from aThemeViewModel).AppThemeresolve the effectivedarkThemefrom the current preference, falling back toisSystemInDarkTheme()when the value isSYSTEM.AppThemeis the single entry point — wire it there.