Skip to content

Add customisable automatic dark/light theme switching#1492

Open
MarkusLitz wants to merge 3 commits intowallabag:masterfrom
MarkusLitz:master
Open

Add customisable automatic dark/light theme switching#1492
MarkusLitz wants to merge 3 commits intowallabag:masterfrom
MarkusLitz:master

Conversation

@MarkusLitz
Copy link
Copy Markdown

Summary

This PR adds the ability for the app to automatically switch between dark and light themes based on the system's dark mode settings. It also allows the user to select which specific light and dark themes they prefer to use for this automatic switching.

Features Added

  • Auto dark mode toggle: A new setting to enable/disable automatic theme switching based on system configuration.
  • Customizable auto-themes: When auto mode is enabled, users can select:
    • Their preferred Auto light theme (from available light themes like Light, Light Contrast, E-Ink).
    • Their preferred Auto dark theme (from available dark themes like Dark, Dark Contrast, Solarized).
  • Immediate updates: Changing the settings applies the theme immediately without requiring an app restart.

Technical Details

  • Updated Themes.java to support an isDark flag and resolve the theme dynamically based on system uiMode and stored preferences.
  • Added new string keys and UI preferences in preferences.xml.
  • Updated SettingsActivity.java to populate the filtered dropdowns and handle preference change listeners for immediate UI updates.

Verification

  • Verified that the code compiles successfully with Java 21 and Android SDK 34.
Android

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant