react-native-screens icon indicating copy to clipboard operation
react-native-screens copied to clipboard

feat: make android header insets switchable

Open WoLewicki opened this issue 2 years ago • 1 comments

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: image Without prop set (default): image

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

WoLewicki avatar Oct 07 '21 09:10 WoLewicki

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.

kacperkapusciak avatar Oct 08 '21 09:10 kacperkapusciak