-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix: navigation bar color management #51956
fix: navigation bar color management #51956
Conversation
@mananjadhav Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Opened an issue with library review here: #51957 |
@@ -12,6 +12,7 @@ | |||
<item name="popupTheme">@style/AppTheme.Popup</item> | |||
<item name="android:spinnerDropDownItemStyle">@style/TextViewSpinnerDropDownItem</item> | |||
<item name="android:alertDialogTheme">@style/AlertDialogTheme</item> | |||
<item name="android:navigationBarColor">@color/black</item> |
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.
Just curious, at what point do we want black and why?
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.
@kirillzyusko can you confirm ?
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.
This is just by default to override all automatic OS color manipulations 🙃
But this color is used on login page - do you want to choose a different one?
The reason why I decided that black is good enough is because below we have an illustration so monochromatic green color may look a little bit inconsistent.
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.
Ah I got it. What do we use for the rest of the app when we are in dark mode?
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.
@shawnborton productDark100
which is #061B09
. And in light mode we use produceLight100
which is #FCFBF9
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.
Okay @shawnborton
Let me re-work it and push new changes 👀
This is the diff between black and brand color:
Black | productDark100 |
---|---|
![]() |
![]() |
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, I think productDark100 looks great personally - cc @Expensify/design for a gut check here, but I say let's do that instead of black.
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'm into it too!
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.
Same. Dig it
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.
Cool, looks like everyone agree to use productDark100
- I pushed these changes, so this PR is ready for review then 😊
Not sure if you need a review from design or not but the video generally looks good to me. Pretty wild how slow the app seems though? |
This is how the app runs on low end device in debug mode 🙈 In this case it's super slow 😅 But in release variant it's pretty fast for this old device!
Well, if you can also download the app on Android and test it, then it would definitely help! ❤️ |
@kirillzyusko most of the code looks good. Can you please check one of the pending author checklist item? |
dcfb3fe
to
d646e9a
Compare
@mananjadhav done 🙌 |
@mananjadhav would you mind to review this PR? |
Just finishing a deploy blocker and then getting to this. |
@mananjadhav any updates here?.. |
I was able to test it on Android 13 but but not on Android 9. I tried my emulator keeps crashing. |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid-nav-bar-2.movandroid-nav-bar-1.movAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
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 tested this in a few recent versions but couldn't test it on Android 9.
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.
HOLDing this as we did not agree internally yet to use this library, instead, we would like to ideally just use only the piece of native code that handles the dynamic colours #51957 cc @jasperhuangg
@kirillzyusko Should we put this PR on hold or close it as you will be able to reuse a lot of the code once edge-to-edge support is added? |
Let's close it in favour of #52392 |
Explanation of Change
Previously we didn't specify
navigationBarColor
at all. It was working well on some devices such as Pixel that managesnavigationBarColor
in a consistent way (on Pixel devices thisnavigationBar
will be always dark, no matter which device theme is set).However some device manufacturers are managing it differently, for example Samsung - they make
navigationBar
to match the color of the device theme (i. e. it will be white if device theme is "light", and will be black if device theme is "dark"). While it sounds pretty logical it produces conflicts in Expensify app: if device theme is "light" but user selected "dark" theme in Expensify app, then the app will be shown in dark mode, but navigation bar will be white. This is exactly what we got in: #51673From above it's clear, that we should manage
navigationBarColor
inside the app and don't rely on default OS management as it may vary depending on manufacturers.This is what this PR brings. Mainly it affects 3 areas (to match closely to iOS):
navigationBar
color should match splash screen color (i. e. to be green);navigationBar
(since this screen supports only dark theme);navigationBar
color depending on theme.To achieve first item (and partially second) I changed
styles.xml
for SplashScreen theme and added defaultnavigationBar
color as#000
.To change color in runtime we need to use additional libs. Mainly I was considering two variants:
So the choice was pretty obvious - I chose
expo-navigation-bar
(we probably need to open an issue for new library).Fixed Issues
$ #51673
PROPOSAL: N/A
Tests
Perform tests at least on two platforms, for example Android 9 (old and popular) and Android 14 (new and popular).
Offline tests
N/A
QA Steps
Perform tests at least on two platforms, for example Android 9 (old and popular) and Android 14 (new and popular).
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
telegram-cloud-document-2-5280970699148649310.mp4
Screen.Recording.2024-11-04.at.16.44.26.mov
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop