zoontek / react-native-edge-to-edge

Effortlessly enable edge-to-edge display in React Native (formerly known as react-native-bars).
MIT License
442 stars 19 forks source link

Add adjustResize compatibility #16

Closed zoontek closed 2 years ago

kneza23 commented 1 year ago

I have tried adjustResize with this new version, but is seems that it still does not work. I use react-navigation , react-native-screens and react-native-safe-area-context

zoontek commented 1 year ago

@kneza23 Are you using native navigation headers?

kneza23 commented 1 year ago

What do you mean? I use @react-navigation/native-stack" with react-native-screens for native screens (android fragments)

zoontek commented 1 year ago

@kneza23 https://reactnavigation.org/docs/headers

Are you using @react-navigation/native-stack built-in headers, or are you using headerShown: false and custom, per screen headers? Do you have a video?

kneza23 commented 1 year ago

Yes i use native headers without custom styling

kneza23 commented 1 year ago

https://user-images.githubusercontent.com/9515181/200335808-5b4b7e7d-fab2-4d5e-9ec5-f74a56ea46de.mov

@zoontek here is the video

kneza23 commented 1 year ago

this is my activity manifest code android:screenOrientation="portrait" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:label="@string/app_name" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true">

zoontek commented 1 year ago

@kneza23 Could you try with TextInput on top (just to confirm it's what I think)?

I know react-navigation suffers from a bug with header + keyboard. It could be fixed using https://github.com/react-navigation/react-navigation/issues/3971#issuecomment-631973105. Quite ugly, but until it's fixed…

kneza23 commented 1 year ago

I will try that, but this worked before with same react-navigation deps, so im not use if it is because of react-native-bars or Andorid 13.

zoontek commented 1 year ago

It happens because of WindowCompat.setDecorFitsSystemWindows(window, false);, which is mandatory for fullscreen system UI. More infos: https://github.com/zoontek/react-native-bars/issues/15#issuecomment-1257997210

Maybe we could tackle this in react-native-screen.

zoontek commented 1 year ago

@kneza23 I removed react-native-bars entirely (and the styles.xml files) in the example app and react-navigation behaves exactly the same way:

https://user-images.githubusercontent.com/1902323/200357921-35cd991d-3ee0-490f-a98e-8b5e5126d6a1.mp4