fix: navigation bar color management#51956
fix: navigation bar color management#51956kirillzyusko wants to merge 3 commits intoExpensify:mainfrom
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 |
| <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.
Just curious, at what point do we want black and why?
There was a problem hiding this comment.
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.
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.
@shawnborton productDark100 which is #061B09. And in light mode we use produceLight100 which is #FCFBF9
There was a problem hiding this comment.
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.
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.
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 |
mananjadhav
left a comment
There was a problem hiding this comment.
I tested this in a few recent versions but couldn't test it on Android 9.
mountiny
left a comment
There was a problem hiding this comment.
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
navigationBarColorat all. It was working well on some devices such as Pixel that managesnavigationBarColorin a consistent way (on Pixel devices thisnavigationBarwill be always dark, no matter which device theme is set).However some device manufacturers are managing it differently, for example Samsung - they make
navigationBarto 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
navigationBarColorinside 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):
navigationBarcolor should match splash screen color (i. e. to be green);navigationBar(since this screen supports only dark theme);navigationBarcolor depending on theme.To achieve first item (and partially second) I changed
styles.xmlfor SplashScreen theme and added defaultnavigationBarcolor 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 Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.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