Skip to content
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

[HOLD for payment 2021-12-13] Android - Status bar changes color when the app is loading at launch #6284

Closed
isagoico opened this issue Nov 12, 2021 · 21 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@isagoico
Copy link

isagoico commented Nov 12, 2021

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Force close the app
  2. Reopen and check the status bar above

Expected Result:

Status bar should not change colors while the app is loading

Actual Result:

Status bar changes colors from grey to white while the app is loading

Workaround:

No need, visual issue.

Platform:

Where is this issue occurring?

  • Android

Version Number: 1.1.14-0

Reproducible in staging?: Yes
Reproducible in production?: Yes

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

New.Expensify.mp4

Expensify/Expensify Issue URL:

Issue reported by: Neyaz Ahmad
Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1636652626134800

View all open jobs on GitHub

CC @mallenexpensify @Julesssss

@MelvinBot
Copy link

Triggered auto assignment to @nkuoch (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@mdneyazahmad
Copy link
Contributor

As requested by @isagoico

@kakajann
Copy link
Contributor

Proposal

  1. Add new color value to android/app/src/main/res/values/colors.xml
<color name="white">#FAFAFA</color>
  1. Add new styles to AppTheme in android/app/src/main/res/values/styles.xml
<item name="android:statusBarColor">@color/white</item>
<item name="android:windowLightStatusBar">true</item>
  1. Remove StatusBar animation in here (the second parameter should be false)
    StatusBar.setBarStyle('dark-content', true);
    StatusBar.setBackgroundColor('transparent', true);

Result

Screen_Recording_20211113-113125_New.Expensify.mp4

@nkuoch nkuoch added Weekly KSv2 External Added to denote the issue can be worked on by a contributor and removed Daily KSv2 labels Nov 15, 2021
@MelvinBot
Copy link

Triggered auto assignment to @trjExpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@MelvinBot MelvinBot added Daily KSv2 and removed Weekly KSv2 labels Nov 15, 2021
@nkuoch nkuoch added Monthly KSv2 and removed Daily KSv2 labels Nov 15, 2021
@trjExpensify
Copy link
Contributor

trjExpensify commented Nov 15, 2021

@mallenexpensify you wanted to be tagged in this issue once created. Anything to add, or can I get this to Upwork? (Popping back on Daily until this is posted and out to contributors)

@trjExpensify trjExpensify self-assigned this Nov 15, 2021
@trjExpensify trjExpensify added Daily KSv2 and removed Monthly KSv2 labels Nov 15, 2021
@Julesssss Julesssss self-assigned this Nov 15, 2021
@Julesssss
Copy link
Contributor

@trjExpensify I've assigned myself as I'd like to review this one and test it on a few different Android versions. @kakajann's proposal looks good to me, so once this is on UpWork please hire @kakajann

@mallenexpensify
Copy link
Contributor

@trjExpensify , please post to Upwork, thanks

@trjExpensify
Copy link
Contributor

Donezo! Upwork job is up here for you @kakajann: https://www.upwork.com/jobs/~01fd7b70aadc2f612c

@mdneyazahmad can you also apply, so I can pay you out the $250 for reporting the issue. 👍

@botify botify removed the Daily KSv2 label Nov 16, 2021
@MelvinBot MelvinBot added Weekly KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors labels Nov 16, 2021
@trjExpensify trjExpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 16, 2021
@emonidi
Copy link

emonidi commented Nov 16, 2021

Proposal

  1. Add new color value to android/app/src/main/res/values/colors.xml
<color name="white">#FAFAFA</color>
  1. Add new styles to AppTheme in android/app/src/main/res/values/styles.xml
<item name="android:statusBarColor">@color/white</item>
<item name="android:windowLightStatusBar">true</item>
  1. Remove StatusBar animation in here (the second parameter should be false)
    StatusBar.setBarStyle('dark-content', true);
    StatusBar.setBackgroundColor('transparent', true);

Result

Screen_Recording_20211113-113125_New.Expensify.mp4

This solution removes the styling posibility from react layer and next time you want to change the status bar theme/color you will have to fix this on android level which defeats the purpose of using react native. Hardcoding this on a lower layer is just a patch not a solution. Also this will be a huge bottleneck if you ever decide to use darkmode or change the background color of the main body. I don't mean to be critical but I would not accept this solution as a bugfix. It will only open more problems further down the line.

@mdneyazahmad
Copy link
Contributor

@trjExpensify applied on upwork

@kakajann
Copy link
Contributor

This solution removes the styling posibility from react layer and next time you want to change the status bar theme/color you will have to fix this on android level which defeats the purpose of using react native. Hardcoding this on a lower layer is just a patch not a solution. Also this will be a huge bottleneck if you ever decide to use darkmode or change the background color of the main body. I don't mean to be critical but I would not accept this solution as a bugfix. It will only open more problems further down the line.

I don't think it removes any styling possibilities. As mentioned in the issue, the status bar color changes only when you launch the app and it is caused by https://github.com/zoontek/react-native-bootsplash.

So, you'll have to change this

<item name="android:statusBarColor">@color/white</item>
<item name="android:windowLightStatusBar">true</item>

whenever you change the splash screen.

And you can do anything you want to the status bar once the app is mounted. Here's the documentation: https://reactnative.dev/docs/next/statusbar#methods

And I really don't think the react-native is meant to be only Javascript code. You can customize the native codes as well.

@Julesssss
Copy link
Contributor

@emonidi thanks for your comments, but in this case I think the native solution is fine. This status bar UI bug is a common issue in native Android dev, and fixing it here is the simplest solution IMO. We have a lot more control by setting Android styles/themes here, and not every case can be handled at the RN layer -- we often need to make changes to native code.

@emonidi
Copy link

emonidi commented Nov 16, 2021

@emonidi thanks for your comments, but in this case I think the native solution is fine. This status bar UI bug is a common issue in native Android dev, and fixing it here is the simplest solution IMO. We have a lot more control by setting Android styles/themes here, and not every case can be handled at the RN layer -- we often need to make changes to native code.

After looking at it deeper I realized what the problem is and my criticism was out of place. @kakajann you are right this in that case is possibly the best solution.

@kakajann
Copy link
Contributor

@Julesssss PR is ready to review

@Julesssss
Copy link
Contributor

Merged, awaiting payment.

@Julesssss Julesssss changed the title Android - Status bar changes color when the app is loading at launch [Pay on Tue 30th November] Android - Status bar changes color when the app is loading at launch Nov 23, 2021
@kakajann
Copy link
Contributor

kakajann commented Dec 2, 2021

Reminder)

@MelvinBot MelvinBot removed the Overdue label Dec 2, 2021
@Julesssss
Copy link
Contributor

Julesssss commented Dec 2, 2021

Hi @kakajann, sorry but I now realize I set the payment date to 7 days after the merge, instead of deployment (which happened 3 days ago). Resetting the timer.

@Julesssss Julesssss changed the title [Pay on Tue 30th November] Android - Status bar changes color when the app is loading at launch [Pay on Mon 6th December] Android - Status bar changes color when the app is loading at launch Dec 2, 2021
@Julesssss Julesssss added the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 2, 2021
@Julesssss Julesssss changed the title [Pay on Mon 6th December] Android - Status bar changes color when the app is loading at launch Android - Status bar changes color when the app is loading at launch Dec 2, 2021
@Julesssss
Copy link
Contributor

Actally, we have a bot for this now ❤️

@Julesssss Julesssss removed the Awaiting Payment Auto-added when associated PR is deployed to production label Dec 2, 2021
@kakajann
Copy link
Contributor

kakajann commented Dec 6, 2021

Reminding the Upwork again

@trjExpensify
Copy link
Contributor

Paid 👍

@botify botify added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Dec 6, 2021
@botify botify changed the title Android - Status bar changes color when the app is loading at launch [HOLD for payment 2021-12-13] Android - Status bar changes color when the app is loading at launch Dec 6, 2021
@botify
Copy link

botify commented Dec 6, 2021

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.1.17-7 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2021-12-13. 🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Engineering External Added to denote the issue can be worked on by a contributor Weekly KSv2
Projects
None yet
Development

No branches or pull requests

10 participants