Commit 9e066ad
authored
fix(Android, Stack): incorrect header height values (#3402)
## Description
Fixes header height values reported via `onHeaderHeightChange` event.
Fixes
#3040.
Fixes
#2661.
> [!NOTE]
>
> Due to incorrect values being reported previously, there are some
workarounds in `react-navigation`'s `NativeStackView.native.tsx`. Those
should be redundant now and we should clean-up that code when this PR is
merged. We intend to handle backward compatibility through a flag. PR in
`react-navigation`:
react-navigation/react-navigation#12852.
| before | after |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/b5d2a967-f9d8-480a-9c28-41309f7b8f03"
/> | <video
src="https://github.com/user-attachments/assets/476a044a-352e-42fa-b67a-8d72a4a6f795"
/> |
## Changes
- report height of the header instead of Screen's top offset
- convert px to dp
- update `TestHeaderHeight` to allow testing dynamic changes to the prop
and `react-navigation`'s `useHeaderHeight()` hook
## Test code and steps to reproduce
Run `TestHeaderHeight`.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes1 parent 942e6ce commit 9e066ad
File tree
6 files changed
+206
-27
lines changed- android/src/main/java/com/swmansion/rnscreens
- events
- apps/src/tests
- src
6 files changed
+206
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | 190 | | |
194 | 191 | | |
195 | 192 | | |
| |||
458 | 455 | | |
459 | 456 | | |
460 | 457 | | |
461 | | - | |
| 458 | + | |
462 | 459 | | |
463 | 460 | | |
464 | 461 | | |
465 | 462 | | |
466 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
467 | 470 | | |
468 | 471 | | |
469 | 472 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
| |||
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
216 | 220 | | |
217 | 221 | | |
218 | 222 | | |
| 223 | + | |
219 | 224 | | |
220 | 225 | | |
221 | 226 | | |
| |||
336 | 341 | | |
337 | 342 | | |
338 | 343 | | |
| 344 | + | |
| 345 | + | |
339 | 346 | | |
340 | 347 | | |
341 | 348 | | |
| |||
Lines changed: 17 additions & 0 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 | + | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments