-
Notifications
You must be signed in to change notification settings - Fork 858
[DynamicColors] Add support for dynamic colors #4850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4850 +/- ##
==========================================
- Coverage 83.90% 83.82% -0.08%
==========================================
Files 596 596
Lines 48460 48543 +83
Branches 6680 6691 +11
==========================================
+ Hits 40659 40693 +34
- Misses 5533 5578 +45
- Partials 2268 2272 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Great job, no security vulnerabilities found in this Pull Request |
BitwardenTheme(theme = state.theme) { | ||
BitwardenTheme( | ||
theme = state.theme, | ||
dynamicColor = state.isDynamicColorsEnabled, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did the design team map the colors properly?
They are not one-to-one and we can never guarantee that colors meet accessibility requirements or that everything will even work correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a warning when dynamic colors is enabled so users are aware of the risks.
The way BitwardenColorSchemes
is designed gives us enough flexibility that it doesn't need to be 1:1. The only component that we're seeing issue with is the switch, which I can fix with a simple change to the attribute we're mapping to. I think, with a little bit of finesse, we can work around the other concerns of multi-tonal icons and illustrations. Kudos to you for setting it up this way.
To keep concerns separate I'm going to open different PRs with my ideas to tackle those other hurdles.
005adbf
to
763422a
Compare
Warning @SaintPatrck Uploading code coverage report failed. Please check the "Upload to codecov.io" step of Process Test Reports job for more details. |
f7ab014
to
e0ec47e
Compare
) | ||
mutableIsDynamicColorsEnabledFlow.tryEmit(value) | ||
} | ||
override val isDynamicColorsEnabledFlow: Flow<Boolean?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get some spaces between these vars
e0ec47e
to
fbebe6f
Compare
5f7f328
to
1584325
Compare
@@ -120,6 +124,17 @@ class FakeSettingsDiskSource : SettingsDiskSource { | |||
get() = mutableAppThemeFlow.onSubscription { | |||
emit(appTheme) | |||
} | |||
override var isDynamicColorsEnabled: Boolean? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a new line above this
This commit introduces 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`.
- Changed the toggle button switch color to `onPrimary` in the `dynamicColorScheme`.
This commit introduces a warning dialog that is displayed when the user attempts to enable dynamic colors in the appearance settings.
1584325
to
a9fc13d
Compare
🎟️ Tracking
📔 Objective
Introduce support for dynamic colors in the application.
isDynamicColorsEnabled
is added toSettingsDiskSource
andSettingsRepository
to persist and retrieve the dynamic colors preference.isDynamicColorsEnabledFlow
is added to track the changes ofisDynamicColorsEnabled
.MainState
is updated with theisDynamicColorsEnabled
attribute.BitwardenTheme
is updated to set the dynamic color.AppearanceViewModel
is updated to set theisDynamicColorsEnabled
.📸 Screenshots
Coming soon!
⏰ Reminders before review
🦮 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