[PR #1959] [MERGED] [BEEEP] [PS-940] Support for dark theme selection while using Default (System) theme #3254

Closed
opened 2025-11-26 23:30:20 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/1959
Author: @mpbw2
Created: 6/17/2022
Status: Merged
Merged: 6/21/2022
Merged by: @mpbw2

Base: masterHead: feature-autodarkthemeselect


📝 Commits (2)

  • 3c9ea1a support for dark theme selection while using Default (System) theme
  • 04bceda refinements

📊 Changes

11 files changed (+1476 additions, -3358 deletions)

View changed files

📝 src/Android/Utilities/ThemeHelpers.cs (+2 -2)
📝 src/App/Pages/Settings/OptionsPage.xaml (+17 -0)
📝 src/App/Pages/Settings/OptionsPage.xaml.cs (+2 -0)
📝 src/App/Pages/Settings/OptionsPageViewModel.cs (+39 -13)
📝 src/App/Resources/AppResources.Designer.cs (+1351 -3332)
📝 src/App/Resources/AppResources.resx (+10 -0)
📝 src/App/Utilities/ThemeManager.cs (+28 -9)
📝 src/Core/Abstractions/IStateService.cs (+2 -0)
📝 src/Core/Constants.cs (+1 -0)
📝 src/Core/Services/StateService.cs (+22 -0)
📝 src/iOS.Core/Utilities/ThemeHelpers.cs (+2 -2)

📄 Description

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Now you can select which dark theme to use when using the Default (System) (automatic light/dark) theme. (Previously only the "Dark" theme was used).

When Default (System) is the selected theme, a new Default Dark Theme option appears immediately below the Theme option. It defaults to "Dark" but allows "Black" and "Nord" to be selected as well. When the device/OS is in dark mode, the selected dark theme becomes active. This section is only visible while the Default (System) theme is selected.

Code changes

  • OptionsPage.xaml/cs/ViewModel: Added the UI & selection control logic for the Options screen within Settings
  • ThemeManager.cs: Added autoDarkTheme arg & logic
  • StateService.cs: Added get/save methods for AutoDarkTheme
  • Constants.cs: Added AutoDarkThemeKey for storage

Screenshots

System/OS in light mode with Default (System) theme & custom default dark themes selected:

01

System/OS in dark mode with Default (System) theme & custom default dark themes selected:

02

Light & dark themes selected, Default Dark Theme section not visible

03

Before you submit

  • I have checked for formatting errors (dotnet tool run dotnet-format --check) (required)
  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/1959 **Author:** [@mpbw2](https://github.com/mpbw2) **Created:** 6/17/2022 **Status:** ✅ Merged **Merged:** 6/21/2022 **Merged by:** [@mpbw2](https://github.com/mpbw2) **Base:** `master` ← **Head:** `feature-autodarkthemeselect` --- ### 📝 Commits (2) - [`3c9ea1a`](https://github.com/bitwarden/android/commit/3c9ea1a272310ec3fdc9d66c66efb562bbff9070) support for dark theme selection while using Default (System) theme - [`04bceda`](https://github.com/bitwarden/android/commit/04bcedaa039453b081180585421061649e00a3dc) refinements ### 📊 Changes **11 files changed** (+1476 additions, -3358 deletions) <details> <summary>View changed files</summary> 📝 `src/Android/Utilities/ThemeHelpers.cs` (+2 -2) 📝 `src/App/Pages/Settings/OptionsPage.xaml` (+17 -0) 📝 `src/App/Pages/Settings/OptionsPage.xaml.cs` (+2 -0) 📝 `src/App/Pages/Settings/OptionsPageViewModel.cs` (+39 -13) 📝 `src/App/Resources/AppResources.Designer.cs` (+1351 -3332) 📝 `src/App/Resources/AppResources.resx` (+10 -0) 📝 `src/App/Utilities/ThemeManager.cs` (+28 -9) 📝 `src/Core/Abstractions/IStateService.cs` (+2 -0) 📝 `src/Core/Constants.cs` (+1 -0) 📝 `src/Core/Services/StateService.cs` (+22 -0) 📝 `src/iOS.Core/Utilities/ThemeHelpers.cs` (+2 -2) </details> ### 📄 Description ## Type of change - [ ] Bug fix - [X] New feature development - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [ ] Other ## Objective <!--Describe what the purpose of this PR is. For example: what bug you're fixing or what new feature you're adding--> Now you can select which dark theme to use when using the `Default (System)` (automatic light/dark) theme. (Previously only the "Dark" theme was used). When `Default (System)` is the selected theme, a new `Default Dark Theme` option appears immediately below the `Theme` option. It defaults to "Dark" but allows "Black" and "Nord" to be selected as well. When the device/OS is in dark mode, the selected dark theme becomes active. This section is only visible while the `Default (System)` theme is selected. ## Code changes <!--Explain the changes you've made to each file or major component. This should help the reviewer understand your changes--> <!--Also refer to any related changes or PRs in other repositories--> * **OptionsPage.xaml/cs/ViewModel:** Added the UI & selection control logic for the `Options` screen within `Settings` * **ThemeManager.cs:** Added `autoDarkTheme` arg & logic * **StateService.cs:** Added get/save methods for `AutoDarkTheme` * **Constants.cs:** Added `AutoDarkThemeKey` for storage ## Screenshots <!--Required for any UI changes. Delete if not applicable--> ## System/OS in light mode with `Default (System)` theme & custom default dark themes selected: <img width="825" alt="01" src="https://user-images.githubusercontent.com/59324545/174385851-03affbd6-53ae-4bf0-b1b8-a2ccc0c6c3f5.png"> ## System/OS in dark mode with `Default (System)` theme & custom default dark themes selected: <img width="823" alt="02" src="https://user-images.githubusercontent.com/59324545/174385866-49a4f53a-a43a-4f1f-a571-5cfa5af579de.png"> ## Light & dark themes selected, `Default Dark Theme` section not visible <img width="825" alt="03" src="https://user-images.githubusercontent.com/59324545/174385875-4d170ed7-6386-444c-ac91-8e53d3440889.png"> ## Before you submit - [X] I have checked for formatting errors (`dotnet tool run dotnet-format --check`) (required) - [ ] I have added **unit tests** where it makes sense to do so (encouraged but not required) - [ ] This change requires a **documentation update** (notify the documentation team) - [ ] This change has particular **deployment requirements** (notify the DevOps team) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-26 23:30:20 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#3254