Commit 3644f6b
authored
fix(Android, FormSheet): Add fallback for undefined corner radius (#3291)
## Description
While working on a different task, I noticed that on Android API level
28 or below, the FormSheet might not display correctly. The issue was
caused by passing a negative corner radius value when it was `undefined`
on the JS side, which `ShapeAppearanceModel` could not handle properly.
This PR adds a fallback to 0 when the value is not provided.
Fixes
software-mansion/react-native-screens-labs#480
## Changes
- Added a fallback for `sheetCornerRadius` prop
## Screenshots / GIFs
### Before
<img width="430" height="848" alt="Screenshot 2025-10-10 at 14 57 47"
src="https://github.com/user-attachments/assets/3dfa849d-d574-4d15-985e-a8e83615e099"
/>
### After
<img width="433" height="844" alt="Screenshot 2025-10-10 at 14 58 10"
src="https://github.com/user-attachments/assets/24fdaaa8-4a1a-4d61-a2e6-c65fd1799f91"
/>
## Test code and steps to reproduce
You can open `GlossyFormSheet` from `TestFormSheet` on Android 28 or
lower; I haven't defined `sheetCornerRadius` there.
## Checklist
- [x] Included code example that can be used to test this change
- [x] Ensured that CI passes1 parent c11e153 commit 3644f6b
File tree
2 files changed
+4
-2
lines changed- android/src/main/java/com/swmansion/rnscreens
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
518 | 519 | | |
519 | 520 | | |
520 | 521 | | |
521 | | - | |
| 522 | + | |
522 | 523 | | |
523 | 524 | | |
524 | 525 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
367 | 368 | | |
368 | 369 | | |
369 | 370 | | |
370 | | - | |
| 371 | + | |
371 | 372 | | |
372 | 373 | | |
373 | 374 | | |
| |||
0 commit comments