react-native-screens
react-native-screens copied to clipboard
feat: make android header insets switchable
Description
PR adding prop for disabling header insets on Android, which make the header subviews not responsive. They are present by default to mimic the behavior of iOS having insets around the header corners.
Screenshots / GIFs
With prop set:
Without prop set (default):
Test code and steps to reproduce
Test1157.tsx
Checklist
- [x] Included code example that can be used to test this change
- [x] Updated TS types
- [x] Updated documentation:
- [x] https://github.com/software-mansion/react-native-screens/blob/master/guides/GUIDE_FOR_LIBRARY_AUTHORS.md
- [x] https://github.com/software-mansion/react-native-screens/blob/master/native-stack/README.md
- [x] https://github.com/software-mansion/react-native-screens/blob/master/createNativeStackNavigator/README.md
- [x] https://github.com/software-mansion/react-native-screens/blob/master/src/types.tsx
- [x] https://github.com/software-mansion/react-native-screens/blob/master/src/native-stack/types.tsx
- [ ] Ensured that CI passes
I have a feeling that this change makes the behaviour between platforms more separated. With #1157 where insets for iOS just work™ now and the developer can move headerLeft
/headerRight
closer to device edges with margin, the same thing should apply to Android without using an additional prop.
What I propose is to make the behaviour added in this PR a default behaviour (without the prop) and move headerLeft
/headerRIght
elements to their native places with margin or padding or any other way.
I hope that way would make the behaviour of platforms closer to each other without disturbing developer experience.