[PR #4850] [MERGED] [DynamicColors] Add support for dynamic colors #5257

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

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/4850
Author: @SaintPatrck
Created: 3/11/2025
Status: Merged
Merged: 5/13/2025
Merged by: @SaintPatrck

Base: mainHead: innovation-sprint/dynamic-colors/set-enabled


📝 Commits (4)

  • cb7848f Add support for dynamic colors
  • a2702c4 Refactor: Update toggle button switch dynamic color scheme
  • f3a3f9f Display a warning dialog when enabling dynamic colors
  • 29c5b12 Add tests

📊 Changes

16 files changed (+463 additions, -47 deletions)

View changed files

📝 app/src/main/java/com/x8bit/bitwarden/MainActivity.kt (+4 -1)
📝 app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt (+20 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSource.kt (+10 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceImpl.kt (+17 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/repository/SettingsRepository.kt (+10 -0)
📝 app/src/main/java/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryImpl.kt (+16 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/components/toggle/BitwardenSwitch.kt (+45 -41)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceScreen.kt (+50 -0)
📝 app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModel.kt (+87 -1)
📝 app/src/main/res/values/strings.xml (+3 -0)
📝 app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt (+4 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceTest.kt (+41 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/disk/util/FakeSettingsDiskSource.kt (+16 -0)
📝 app/src/test/java/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryTest.kt (+30 -0)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceScreenTest.kt (+36 -4)
📝 app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModelTest.kt (+74 -0)

📄 Description

🎟️ Tracking

PM-10660
PM-20285
Closes #3681

📔 Objective

Introduce support for dynamic colors in the application.

  • A new setting isDynamicColorsEnabled is added to SettingsDiskSource and SettingsRepository to persist and retrieve the dynamic colors preference.
  • A new flow isDynamicColorsEnabledFlow is added to track the changes of isDynamicColorsEnabled.
  • A new switch "Dynamic colors" is added in the Appearance Screen.
  • The MainState is updated with the isDynamicColorsEnabled attribute.
  • BitwardenTheme is updated to set the dynamic color.
  • The AppearanceViewModel is updated to set the isDynamicColorsEnabled.

📸 Screenshots

https://github.com/user-attachments/assets/5fa0acaa-3a8a-490d-8dad-a188672b46e8

Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

🔄 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/4850 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 3/11/2025 **Status:** ✅ Merged **Merged:** 5/13/2025 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `innovation-sprint/dynamic-colors/set-enabled` --- ### 📝 Commits (4) - [`cb7848f`](https://github.com/bitwarden/android/commit/cb7848f18b1e9baaa225c735064935f641439336) Add support for dynamic colors - [`a2702c4`](https://github.com/bitwarden/android/commit/a2702c44090db97f2d648fbf860427e9189adfa2) Refactor: Update toggle button switch dynamic color scheme - [`f3a3f9f`](https://github.com/bitwarden/android/commit/f3a3f9f19a3a50209764a0a849af813fd8b01dd8) Display a warning dialog when enabling dynamic colors - [`29c5b12`](https://github.com/bitwarden/android/commit/29c5b12ea1b8d2262a9220df1ab7360677568eff) Add tests ### 📊 Changes **16 files changed** (+463 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/java/com/x8bit/bitwarden/MainActivity.kt` (+4 -1) 📝 `app/src/main/java/com/x8bit/bitwarden/MainViewModel.kt` (+20 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSource.kt` (+10 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceImpl.kt` (+17 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/repository/SettingsRepository.kt` (+10 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryImpl.kt` (+16 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/components/toggle/BitwardenSwitch.kt` (+45 -41) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceScreen.kt` (+50 -0) 📝 `app/src/main/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModel.kt` (+87 -1) 📝 `app/src/main/res/values/strings.xml` (+3 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/MainViewModelTest.kt` (+4 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/disk/SettingsDiskSourceTest.kt` (+41 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/datasource/disk/util/FakeSettingsDiskSource.kt` (+16 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/data/platform/repository/SettingsRepositoryTest.kt` (+30 -0) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceScreenTest.kt` (+36 -4) 📝 `app/src/test/java/com/x8bit/bitwarden/ui/platform/feature/settings/appearance/AppearanceViewModelTest.kt` (+74 -0) </details> ### 📄 Description ## 🎟️ Tracking PM-10660 PM-20285 Closes #3681 ## 📔 Objective Introduce support for dynamic colors in the application. - A new setting `isDynamicColorsEnabled` is added to `SettingsDiskSource` and `SettingsRepository` to persist and retrieve the dynamic colors preference. - A new flow `isDynamicColorsEnabledFlow` is added to track the changes of `isDynamicColorsEnabled`. - A new switch "Dynamic colors" is added in the Appearance Screen. - The `MainState` is updated with the `isDynamicColorsEnabled` attribute. - `BitwardenTheme` is updated to set the dynamic color. - The `AppearanceViewModel` is updated to set the `isDynamicColorsEnabled`. ## 📸 Screenshots https://github.com/user-attachments/assets/5fa0acaa-3a8a-490d-8dad-a188672b46e8 ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- <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:56:31 -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#5257