-
Notifications
You must be signed in to change notification settings - Fork 4
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
[MOB-2561] Ecosia theme review and fixes #681
[MOB-2561] Ecosia theme review and fixes #681
Conversation
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.
Nice color paintings 👨🎨
Added one clarification comment that is not a blocker
if LegacyThemeManager.instance.systemThemeIsOn { | ||
let userInterfaceStyle = UIScreen.main.traitCollection.userInterfaceStyle | ||
LegacyThemeManager.instance.current = userInterfaceStyle == .dark ? LegacyDarkTheme() : LegacyNormalTheme() | ||
} | ||
|
||
changeCurrentTheme(loadInitialThemeType()) |
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.
It feels like what you do here is exactly what should happen inside changeCurrentTheme(loadInitialThemeType())
. I guess this has to do with the cold start, but any reason why not keeping just one of the two?
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.
@lucaschifino thanks for asking!
While it may look the same, a small check makes (on our codebase with our references of the LegacyThemeManager
throughout it) the whole logic behaves unexpectedly (from the User perspective), setting the wrong theme.
Within loadInitialThemeType()
, a check of a persisted value is made 👇
let savedThemeDescription = userDefaults.string(forKey: ThemeKeys.themeName)
.
This check will extract the last saved theme before killing the app, therefore a different one in case we switched at app killed state where no observers were alive.
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.
Got it! It's ok to leave it like that by me, but maybe making that a bit clearer for people reading the code would be good, either a comment like // Additional check in case the theme changed while the app was closed
on top of your code or renaming the existing method to changeCurrentTheme(loadInitialStoredThemeType())
.
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.
Good input will do that
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.
Nice color paintings 👨🎨
Added one clarification comment that is not a blocker
For some reason it went duplicated 🤷
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.
Awesome, thanks ❤️
MOB-2561
Context
Throughout the testing of the latest upgrade version, some Theming issues arose.
This PR aims to fix all of them as well as provide a bit of touch to some details already present in production.
Approach
Also acknowledged the root cause of the theming issue when the app performs a cold start. The issue behind the
LegacyThemeManager
that needed another entry point in this current codebase and the fact that our landing is theWelcome
screen / onboarding.GIF showcasing the fix for all of them
Other
The UI theming applied to the Done button is a personal proposal. The Done button is Green throughout the app in dark mode so I thought would be good to align it.
Before merging
Checklist
// Ecosia:
helper comments where needed