:feature:settings

Purpose: Theme (light/dark/system + dynamic color), language, and sign-out, shown as a dialog rather than a full screen. SettingsViewModel uses SettingsRepository in :data; theme/color/profile values come from JSON DataStore, while language uses app locales.

Key APIs

APIWhat it does
SettingsDialog / SettingsViewModelTheme + dynamic-color toggles, language selection, sign-out, open-source licenses

Destination signature excerpt; imports and function body are omitted.

// feature/settings/src/main/kotlin/dev/atick/feature/settings/ui/SettingsDialog.kt
@Composable
fun SettingsDialog(
onDismiss: () -> Unit,
onShowSnackbar: suspend (String, SnackbarAction, Throwable?) -> Boolean,
settingsViewModel: SettingsViewModel = hiltViewModel(),
)

Gotchas

  • The language picker's when maps every non-Arabic locale to English — adding a new values-<lang>/ resource directory changes what generateLocaleConfig offers the system without updating this mapping.

  • Sign-out calls Firebase Auth, then resets all preferences, including theme/color settings. It does not delete Room or Firestore records.

  • Resubscription can add repository collectors while the ViewModel remains alive; the settings load catch currently constructs a state without storing its error. See subscription lifetimes.

  • Follow localization when adding a language; resource files alone do not update the in-app picker/mapping.

Related Documentation

Packages

Link copied to clipboard