Skip to content

๐ŸŽจ Contrast / Theme Settings

Users can choose between Light, Dark, or System Default themes.
This improves accessibility, especially for visually impaired users or those with light sensitivity.


๐Ÿง‘โ€๐Ÿ’ป Available Options

  • Default โ€“ Follows system settings
  • Black on White โ€“ Light theme
  • White on Black โ€“ Dark theme

โœ… How It Works

  1. The settings screen includes a group of radio buttons for theme selection.
  2. When a user selects a theme, the app applies it using:

```kotlin AppCompatDelegate.setDefaultNightMode(MODE) ````

  1. The app then restarts to apply the theme using requireActivity().recreate() or equivalent.

๐Ÿ” Persistence

  • The selected mode is saved in SharedPreferences under the key:

text app_contrast_mode

  • Available values:

kotlin MODE_NIGHT_NO // Light theme MODE_NIGHT_YES // Dark theme MODE_NIGHT_FOLLOW_SYSTEM // System default


โœ… Default Behavior

If the user doesnโ€™t make a selection, the app defaults to the systemโ€™s light/dark mode setting.