Commit fe80756
authored
fix(Android): remove setting system bar translucent props from JS if in edge to edge (#2949)
## Description
Fixes #2948
Fixes an issue where system bar styles set using `SystemBars.setStyle`
function from `react-native-edge-to-edge` would be overridden by default
values set in `react-native-screens`. Those should only work when we
define system bar styles via screen options but in
#2464 that
integrated `react-native-edge-to-edge` with `react-native-screens`, we
would always set `statusBarTranslucent` and `navigationBarTranslucent`
props when in edge to edge ([code
here](https://github.com/software-mansion/react-native-screens/pull/2464/files#diff-d51c072177510e603797455a4c3c14a049d0cfdbd39132fb53a6c187de8b7789R30-R31)),
which would set
`didSetStatusBarAppearance`/`didSetNavigationBarAppearance` and in
result, make `screens` use default values for system bar styles.
Setting `statusBarTranslucent` and `navigationBarTranslucent` props to
`true` in edge-to-edge is not necessary and it's currently ignored in
native code when in edge-to-edge after
#2913
([here](https://github.com/software-mansion/react-native-screens/pull/2913/files#diff-49e80f92048eb21d46beae35985ce78f79217693be04df175e5e679878d0f2c7R158)
and
[there](https://github.com/software-mansion/react-native-screens/pull/2913/files#diff-49e80f92048eb21d46beae35985ce78f79217693be04df175e5e679878d0f2c7R234)).
Thanks to @efstathiosntonas for [reporting the issue and
finding](#2913 (comment))
the culprit!
## Changes
- remove setting `statusBarTranslucent` and `navigationBarTranslucent`
in `edge-to-edge.tsx`
- add test screen
## Screenshots / GIFs
| before | after |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/09739d52-7db6-49ac-8e48-1311734e8ff2"
/> | <video
src="https://github.com/user-attachments/assets/cd0dee11-135e-4134-a56c-1dbd20218304"
/> |
## Test code and steps to reproduce
Run `Test2949` **as a main app** by modifying `App.tsx` in example app.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes1 parent 10c9335 commit fe80756
3 files changed
Lines changed: 95 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 28 | + | |
33 | 29 | | |
0 commit comments